Class
BoolToValueConverter

Converts boolean values to specified objects based on true/false conditions.

Definition

Namespace:Telerik.Maui.Controls

Assembly:Telerik.Maui.Controls.dll

Syntax:

cs-api-definition
public class BoolToValueConverter : IValueConverter

Inheritance: objectBoolToValueConverter

Implements: IValueConverter

Constructors

BoolToValueConverter()

Declaration

cs-api-definition
public BoolToValueConverter()

Properties

FalseValue

Gets or sets the value to return when the boolean input is false.

Declaration

cs-api-definition
public object FalseValue { get; set; }

Property Value

object

The value for false condition.

TrueValue

Gets or sets the value to return when the boolean input is true.

Declaration

cs-api-definition
public object TrueValue { get; set; }

Property Value

object

The value for true condition.

Methods

Convert(object, Type, object, CultureInfo)

Converts a boolean value to the corresponding TrueValue or FalseValue.

Declaration

cs-api-definition
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)

Parameters

value

object

The boolean value to convert.

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

TrueValue if the input is true, otherwise FalseValue.

ConvertBack(object, Type, object, CultureInfo)

Converts a value back to a boolean by comparing it with TrueValue.

Declaration

cs-api-definition
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)

Parameters

value

object

The value to convert back.

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

True if the value equals TrueValue, otherwise false.