I'm using the custom ColorPicker
control provided by the Extended WPF Toolkit.
I have a configuration file where the application take the color, this color is in string format, like: #FFF0E68C
.
Now I'm trying to convert the string in color and valorize the ColorPicker
color in this way:
var converter = new BrushConverter();
var brush = (Brush)converter.ConvertFromString("#FFF0E68C");
MyColorPicker.SelectedColor = brush;
but on the last line I get this error:
Implicit conversion from the type 'System.Windows.Media.Brush' in 'System.Windows.Media.Color?'
I doesn't have any Media.Color
in brush
, how can I fix this? Maybe someone know a better solution for achieve this target?
Thanks in advance.
May be you donn't need to use BrushConverter and Brush, you should use ColorConverter and Color