Files
Ursa.Avalonia/src/Ursa.Themes.Semi/Converters/BrushToColorConverter.cs
2024-07-30 18:33:30 +08:00

22 lines
572 B
C#

using System.Globalization;
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();
}
}