Class ColorToBrushConverter
This class converts the color value into the brush and vice versa.
Inheritance
System.Object
ColorToBrushConverter
Implements
Microsoft.Maui.Controls.IValueConverter
Namespace: Syncfusion.Maui.Core.Converters
Assembly: Syncfusion.Maui.Core.dll
Syntax
public class ColorToBrushConverter : Object, IValueConverter
Constructors
ColorToBrushConverter()
Declaration
public ColorToBrushConverter()
Methods
Convert(Object, Type, Object, CultureInfo)
Converts color value to an brush type.
Declaration
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
Parameters
Type | Name | Description |
---|---|---|
System.Object | value | The value must be the type of color |
System.Type | targetType | The type of the target property |
System.Object | parameter | An additional parameter for the converter to handle, not used |
System.Globalization.CultureInfo | culture | The culture to use in the converter, not used |
Returns
Type | Description |
---|---|
System.Object | SolidColorBrush |
Exceptions
Type | Condition |
---|---|
System.ArgumentException | Exception thrown when the value type is null or not a type of Color |
ConvertBack(Object, Type, Object, CultureInfo)
Converts back the brush to color type.
Declaration
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
Parameters
Type | Name | Description |
---|---|---|
System.Object | value | The value must be the type of SolidColorBrush |
System.Type | targetType | The type of the target property |
System.Object | parameter | An additional parameter for the converter to handle, not used |
System.Globalization.CultureInfo | culture | The culture to use in the converter, not used |
Returns
Type | Description |
---|---|
System.Object | Color |
Exceptions
Type | Condition |
---|---|
System.ArgumentException | Exception thrown when the value type is null or not a type of SolidColorBrush |
Implements
Microsoft.Maui.Controls.IValueConverter