Class BooleanConverter
- Namespace
- Tudormobile.Wpf.Converters
- Assembly
- Tudormobile.WpfControls.dll
Provides a type converter to convert Boolean values to and from other representations. Values to convert to are provided as properties on the converter.
public class BooleanConverter : IValueConverter
- Inheritance
-
BooleanConverter
- Implements
- Inherited Members
Remarks
This class is typically used to convert Boolean values to and from strings or other data types in scenarios such as data binding, serialization, or user interface interactions. If TrueValue or FalseValue are not set, the converter will return an appropriate guess based on the target type.
Properties
FalseValue
Gets or sets the value that represents a logical "false" value when converting.
public object? FalseValue { get; set; }
Property Value
IsInverted
Gets or sets a value indicating whether the operation is inverted. (True becomes False and vice versa).
public bool IsInverted { get; set; }
Property Value
TrueValue
Gets or sets the value that represents true value when converting.
public object? TrueValue { get; set; }
Property Value
Methods
Convert(object, Type, object?, CultureInfo?)
Converts a value.
public object? Convert(object value, Type targetType, object? parameter, CultureInfo? culture)
Parameters
valueobjectThe value produced by the binding source.
targetTypeTypeThe type of the binding target property.
parameterobjectThe converter parameter to use.
cultureCultureInfoThe culture to use in the converter.
Returns
ConvertBack(object, Type, object?, CultureInfo?)
Converts a value.
public object ConvertBack(object value, Type targetType, object? parameter, CultureInfo? culture)
Parameters
valueobjectThe value that is produced by the binding target.
targetTypeTypeThe type to convert to.
parameterobjectThe converter parameter to use.
cultureCultureInfoThe culture to use in the converter.