Skip to main content

ColorToBrushConverter Class

Definition

Assembly:Avalonia.Markup.Xaml
Package:Avalonia
public class ColorToBrushConverter

Inheritance: object -> ColorToBrushConverter

Implements:IValueConverter

Constructors

NameDescription
ColorToBrushConverterNo summary available.

ColorToBrushConverter Constructor

public ColorToBrushConverter()

Methods

NameDescription
Convert (2 overloads)Converts a Avalonia.Media.Color to an Avalonia.Media.IBrush if the arguments are of the correct type.
ConvertBack (2 overloads)Converts an Avalonia.Media.ISolidColorBrush to a Avalonia.Media.Color if the arguments are of the correct type.

Convert overloads

Convert Method

Converts a Avalonia.Media.Color to an Avalonia.Media.IBrush if the arguments are of the correct type.

public object Convert(object value, Type targetType)
Parameters

value object

The value.

targetType Type

The target type.

Returns

object

If value is a Avalonia.Media.Color and targetType is Avalonia.Media.IBrush then converts the color to a solid color brush.

Convert Method

Converts a Avalonia.Media.Color to an Avalonia.Media.IBrush if the arguments are of the correct type.

public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
Parameters

value object

The value.

targetType Type

The target type.

parameter object

Not used.

culture System.Globalization.CultureInfo

Not used.

Returns

object

If value is a Avalonia.Media.Color and targetType is Avalonia.Media.IBrush then converts the color to a solid color brush.

ConvertBack overloads

ConvertBack Method

Converts an Avalonia.Media.ISolidColorBrush to a Avalonia.Media.Color if the arguments are of the correct type.

public object ConvertBack(object value, Type targetType)
Parameters

value object

The value.

targetType Type

The target type.

Returns

object

If value is an Avalonia.Media.ISolidColorBrush and targetType is Avalonia.Media.Color then converts the solid color brush to a color.

ConvertBack Method

Converts an Avalonia.Media.ISolidColorBrush to a Avalonia.Media.Color if the arguments are of the correct type.

public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
Parameters

value object

The value.

targetType Type

The target type.

parameter object

Not used.

culture System.Globalization.CultureInfo

Not used.

Returns

object

If value is an Avalonia.Media.ISolidColorBrush and targetType is Avalonia.Media.Color then converts the solid color brush to a color.