Class BoolToOpacityConverter
This class converts boolean value to opacity and vice versa.
Inheritance
Implements
Namespace: Syncfusion.Maui.Core.Converters
Assembly: Syncfusion.Maui.Core.dll
Syntax
public class BoolToOpacityConverter : Object, IValueConverter
Constructors
BoolToOpacityConverter()
Declaration
public BoolToOpacityConverter()
Methods
Convert(Object, Type, Object, CultureInfo)
The convert method is used to convert the boolean value to opacity. If the boolean value is true it converts into 1 and if it is false it converts into false.
Declaration
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
Parameters
Type | Name | Description |
---|---|---|
System.Object | value | The source data being passed to the target. |
System.Type | targetType | The type of the target property, as a type reference. |
System.Object | parameter | An optional parameter to be used to invert the converter logic. |
System.Globalization.CultureInfo | culture | The culture to use in the converter |
Returns
Type | Description |
---|---|
System.Object | The value to be passed to the target property. |
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException |
ConvertBack(Object, Type, Object, CultureInfo)
The convert back method is used to convert the opacity value to boolean. If the opacity value is 1 it converts into true and if it is false it converts into 1.
Declaration
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
Parameters
Type | Name | Description |
---|---|---|
System.Object | value | The target data being passed to the source. |
System.Type | targetType | The type of the target property, as a type reference. |
System.Object | parameter | An optional parameter to be used to invert the converter logic. |
System.Globalization.CultureInfo | culture | The culture to use in the converter |
Returns
Type | Description |
---|---|
System.Object | The value to be passed to the source object. |
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException |