ClassStringToBoolConverter
Represents an IValueConverter that converts string values to boolean values. Returns true if the string is not null or empty, or if a parameter is provided and contains the string value.
Definition
Namespace:Telerik.Maui.Controls
Assembly:Telerik.Maui.Controls.dll
Syntax:
public class StringToBoolConverter : IValueConverter
Inheritance: objectStringToBoolConverter
Implements:
Constructors
StringToBoolConverter()
Declaration
public StringToBoolConverter()
Methods
Convert(object, Type, object, CultureInfo)
Converts a string value to a boolean.
Declaration
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
Parameters
value
The string value to convert.
targetType
The type to convert to (should be bool).
parameter
An optional parameter string to check if it contains the value.
culture
The culture to use for the conversion.
Returns
True if the parameter contains the value (case-insensitive), or if parameter is null and value is not null or empty; otherwise, false.
ConvertBack(object, Type, object, CultureInfo)
Converts a boolean value back to a string. This operation is not supported.
Declaration
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
Parameters
value
The boolean value to convert back.
targetType
The type to convert back to.
parameter
An optional parameter (not used).
culture
The culture to use for the conversion (not used).
Returns
This method always throws a NotSupportedException.
Exceptions
Always thrown as conversion back from bool to string is not supported.