优化更新代码,添加界面功能并整合
This commit is contained in:
21
WPFluent/Converters/ColorToBrushConverter.cs
Normal file
21
WPFluent/Converters/ColorToBrushConverter.cs
Normal file
@@ -0,0 +1,21 @@
|
||||
using System;
|
||||
using System.Linq;
|
||||
using System.Windows.Data;
|
||||
|
||||
namespace WPFluent.Converters;
|
||||
|
||||
public 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(); }
|
||||
}
|
||||
Reference in New Issue
Block a user