This project has moved. For the latest updates, please go here.
1
Vote

Add a BooleanInverterConverter

description

For sake of completeness:

[ValueConversion(typeof(bool), typeof(bool))]
public class BooleanInverterConverter : IValueConverter
{
#region IValueConverter Members

public object Convert(object value, Type targetType, object parameter, CultureInfo culture) {
  if (value == null || value == DependencyProperty.UnsetValue)
    return value;

  return !(bool)value;
}


public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) {
  return Convert(value, targetType, parameter, culture);
}

#endregion
}

comments