public object Convert(object value, Type targetType, object parameter, CultureInfo culture) { Color?c = (Color?)value as Color?; System.Windows.Media.BrushConverter converter = new System.Windows.Media.BrushConverter(); object x = null; if (converter.CanConvertFrom(typeof(Color?))) { x = converter.ConvertFrom(c); } return(x); }