22 lines
609 B
C#
22 lines
609 B
C#
using System;
|
|
using System.Linq;
|
|
using System.Windows.Data;
|
|
|
|
namespace WPFluent.Converters;
|
|
|
|
internal class ColorToBrushConverter : IValueConverter
|
|
{
|
|
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
|
|
{
|
|
//var color = (SelectedColor)value;
|
|
if (value is System.Windows.Media.Color color)
|
|
{
|
|
return new SolidColorBrush(color);
|
|
}
|
|
return Binding.DoNothing;
|
|
}
|
|
|
|
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
|
|
{ throw new NotImplementedException(); }
|
|
}
|