2024-09-22 11:05:41 +08:00
|
|
|
|
using System;
|
|
|
|
|
|
using System.Linq;
|
|
|
|
|
|
using System.Windows.Data;
|
|
|
|
|
|
|
2025-02-10 20:53:40 +08:00
|
|
|
|
namespace WPFluent.Converters;
|
|
|
|
|
|
|
2025-04-24 20:56:44 +08:00
|
|
|
|
internal class ColorToBrushConverter : IValueConverter
|
2024-09-22 11:05:41 +08:00
|
|
|
|
{
|
|
|
|
|
|
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
|
|
|
|
|
|
{
|
|
|
|
|
|
//var color = (SelectedColor)value;
|
2025-04-24 20:56:44 +08:00
|
|
|
|
if (value is System.Windows.Media.Color color)
|
2024-09-22 11:05:41 +08:00
|
|
|
|
{
|
|
|
|
|
|
return new SolidColorBrush(color);
|
|
|
|
|
|
}
|
|
|
|
|
|
return Binding.DoNothing;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
|
2025-02-10 20:53:40 +08:00
|
|
|
|
{ throw new NotImplementedException(); }
|
2024-09-22 11:05:41 +08:00
|
|
|
|
}
|