Files
Ursa.Avalonia/src/Ursa.Themes.Semi/Converters/BrushToColorConverter.cs
2023-06-23 23:51:44 +08:00

23 lines
590 B
C#

using System.Globalization;
using Avalonia;
using Avalonia.Data.Converters;
using Avalonia.Media;
namespace Ursa.Themes.Semi.Converters;
public class BrushToColorConverter: IValueConverter
{
public object? Convert(object? value, Type targetType, object? parameter, CultureInfo culture)
{
if (value is ISolidColorBrush b)
{
return b.Color;
}
return Colors.Transparent;
}
public object? ConvertBack(object? value, Type targetType, object? parameter, CultureInfo culture)
{
throw new NotImplementedException();
}
}