Class NullToBooleanConverter
- Namespace
- WindowSill.API
- Assembly
- WindowSill.API.dll
A value converter that converts null/non-null values to boolean values.
public class NullToBooleanConverter : IValueConverter
- Inheritance
-
NullToBooleanConverter
- Implements
- Inherited Members
- Extension Methods
Properties
ValueOnNotNull
Gets or sets the boolean value to return when the input value is not null. Default value is false.
public bool ValueOnNotNull { get; set; }
Property Value
ValueOnNull
Gets or sets the boolean value to return when the input value is null. Default value is true.
public bool ValueOnNull { get; set; }
Property Value
Methods
Convert(object, Type, object, string)
Converts a value to a boolean based on whether it is null or not.
public object Convert(object value, Type targetType, object parameter, string language)
Parameters
valueobjectThe value to convert.
targetTypeTypeThe type to convert to (should be bool).
parameterobjectOptional parameter (not used).
languagestringThe language code (not used).
Returns
- object
ValueOnNull if value is null, otherwise ValueOnNotNull.
ConvertBack(object, Type, object, string)
Converts a boolean value back to the original type. Not implemented.
public object ConvertBack(object value, Type targetType, object parameter, string language)
Parameters
valueobjectThe boolean value to convert back.
targetTypeTypeThe target type to convert to.
parameterobjectOptional parameter (not used).
languagestringThe language code (not used).
Returns
- object
Not implemented.
Exceptions
- NotImplementedException
Always thrown as this method is not implemented.