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
public StringToBoolConverter()
Methods
Converts a string value to a boolean.
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
The string value to convert.
targetTypeTypeThe type to convert to (should be bool).
parameterobjectAn optional parameter string to check if it contains the value.
cultureCultureInfoThe 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.
Converts a boolean value back to a string. This operation is not supported.
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
The boolean value to convert back.
targetTypeTypeThe type to convert back to.
parameterobjectAn optional parameter (not used).
cultureCultureInfoThe 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.