ColorToBrushConverter Class
[ValueConversion(typeof(Color), typeof(Brush))]
public class ColorToBrushConverter : IValueConverter
- Inheritance:
- Object Object
Constructors
ColorToBrushConverter()
public ColorToBrushConverter()
Methods
Convert(Object, Type, Object, CultureInfo)
Converts a value. The data binding engine calls this method when it propagates a value from the binding source to the binding target.
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
Parameter | Type | Description |
---|---|---|
value | Object | The value produced by the binding source. |
targetType | Type | The type of the binding target property. |
parameter | Object | The converter parameter to use. |
culture | CultureInfo | The culture to use in the converter. |
Returns
- Object:
A converted value.
ConvertBack(Object, Type, Object, CultureInfo)
Converts a value. The data binding engine calls this method when it propagates a value from the binding target to the binding source.
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
Parameter | Type | Description |
---|---|---|
value | Object | The value produced by the binding source. |
targetType | Type | The type of the binding target property. |
parameter | Object | The converter parameter to use. |
culture | CultureInfo | The culture to use in the converter. |
Returns
- Object:
A converted value.