public override object ConvertFrom(ITypeDescriptorContext context, CultureInfo culture, object value) { var stringValue = value as string; if (stringValue != null) { return(SolidColorBrushHelper.FromARGB(stringValue)); } return(base.ConvertFrom(context, culture, value)); }
public override object ConvertFrom(ITypeDescriptorContext context, CultureInfo culture, object value) { switch (value) { case string color: return(SolidColorBrushHelper.FromARGB(color)); case Color color: return(new SolidColorBrush(color)); } return(base.ConvertFrom(context, culture, value)); }