This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// a generic wpf boolean value converter class | |
public class GenericBooleanConverter : IValueConverter | |
{ | |
public object TrueValue { get; set; } | |
public object FalseValue { get; set; } | |
public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture) | |
{ | |
return TypeDescriptor.GetConverter(targetType) | |
.ConvertFrom((bool)value ? TrueValue : FalseValue); |