Class SwitchConverter
A value converter that converts an object, based on its Boolean state, to alternate objects.
[ValueConversion(typeof(object), typeof(object))]
public class SwitchConverter : GenericConverter<object, object, object>, IValueConverter
- Inheritance
-
SwitchConverter
- Implements
- Inherited Members
Constructors
SwitchConverter()
Initializes a new instance of the SwitchConverter class.
public SwitchConverter()
Properties
ValueIfFalse
Gets or sets the object that will be returned when the source object is false.
public object ValueIfFalse { get; set; }
Property Value
ValueIfTrue
Gets or sets the value that will be returned when the source object is true.
public object ValueIfTrue { get; set; }
Property Value
Methods
Convert(object, object, CultureInfo)
Converts a value.
public override object Convert(object value, object parameter, CultureInfo culture)
Parameters
value
objectThe value produced by the binding source.
parameter
objectThe converter parameter to use.
culture
CultureInfoThe culture to use in the converter.
Returns
ConvertBack(object, object, CultureInfo)
Converts a value.
public override object ConvertBack(object value, object parameter, CultureInfo culture)
Parameters
value
objectThe value that is produced by the binding target.
parameter
objectThe converter parameter to use.
culture
CultureInfoThe culture to use in the converter.