22 lines
622 B
C#
22 lines
622 B
C#
using System;
|
|
using System.Globalization;
|
|
using System.Windows.Data;
|
|
|
|
namespace WPFDark.Controls.Converters
|
|
{
|
|
public class DoubleColorToBrushConverter : IValueConverter
|
|
{
|
|
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
|
|
{
|
|
if (!(value is DoubleColor item))
|
|
return null!;
|
|
|
|
return Caches.GetSolidColorBrush(item.ByteColor);
|
|
}
|
|
|
|
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
|
|
{
|
|
throw new NotImplementedException();
|
|
}
|
|
}
|
|
} |