New to Telerik UI for .NET MAUIStart a free 30-day trial

Represents an IValueConverter that converts Color values or color name strings to RadSolidColorBrush instances.

Definition

Namespace:Telerik.Maui.Controls

Assembly:Telerik.Maui.Controls.dll

Syntax:

C#
public class ColorToRadBrushConverter : IValueConverter

Inheritance: objectColorToRadBrushConverter

Implements: IValueConverter

Constructors

C#
public ColorToRadBrushConverter()

Methods

Converts a Color or color name string to a RadSolidColorBrush.

C#
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
Parameters:valueobject

The color value to convert. Can be a Color or a string representing a color name.

targetTypeType

The type to convert to.

parameterobject

An optional parameter (not used).

cultureCultureInfo

The culture to use for conversion (not used).

Returns:

object

A RadSolidColorBrush if the value is a valid color; otherwise, the original value.

Converts a value back from the target type. This operation is not implemented.

C#
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
Parameters:valueobject

The value to convert back.

targetTypeType

The type to convert back to.

parameterobject

An optional parameter (not used).

cultureCultureInfo

The culture to use for conversion (not used).

Returns:

object

This method always throws a NotImplementedException.

Exceptions:

NotImplementedException

Always thrown as this conversion is not implemented.