C# Class UWP.Converters.BoolToObjectConverter

This class converts a boolean value into an other object. Can be used to convert true/false to visibility, a couple of colors, couple of images, etc.
Inheritance: IValueConverter
Mostrar archivo Open project: beto-rodriguez/Live-Charts

Public Methods

Method Description
Convert ( object value, Type targetType, object parameter, string language ) : object

Convert a boolean value to an other object.

ConvertBack ( object value, Type targetType, object parameter, string language ) : object

Convert back the value to a boolean

If the value parameter is a reference type, TrueValue must match its reference to return true.

Private Methods

Method Description
Convert ( object value, Type targetType ) : object

Helper method to convert a value from a source type to a target type.

TryParseBool ( object parameter ) : bool

Helper method to safely cast an object to a boolean

Method Details

Convert() public method

Convert a boolean value to an other object.
public Convert ( object value, Type targetType, object parameter, string language ) : object
value object The source data being passed to the target.
targetType System.Type The type of the target property, as a type reference.
parameter object An optional parameter to be used to invert the converter logic.
language string The language of the conversion.
return object

ConvertBack() public method

Convert back the value to a boolean
If the value parameter is a reference type, TrueValue must match its reference to return true.
public ConvertBack ( object value, Type targetType, object parameter, string language ) : object
value object The target data being passed to the source.
targetType System.Type The type of the target property, as a type reference (System.Type for Microsoft .NET, a TypeName helper struct for Visual C++ component extensions (C++/CX)).
parameter object An optional parameter to be used to invert the converter logic.
language string The language of the conversion.
return object