using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Windows; using System.Windows.Interop; using System.Windows.Data; using System.Windows.Media.Imaging; namespace ProgramQueuer.Helpers { /// /// A simple boolean converter that inverts the boolean value. /// [ValueConversion(typeof(bool), typeof(bool))] public class BooleanInverter : IValueConverter { /// /// Convert a boolean value to the inverted value. Seriously, if I have to explain this, then you are in the wrong business. /// /// The boolean value to invert. /// The type of the target value. This property is ignored. /// Parameter to pass to the converter. This property is ignored. /// A reference to the target CultureInfo. This property is ignored. /// An inverted boolean value. public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture) { return !(bool)value; } /// /// Convert an inverted boolean value to it's original value. Basically inverted. /// /// The boolean value to invert back. /// The type of the target value. This property is ignored. /// Parameter to pass to the converter. This property is ignored. /// A reference to the target CultureInfo. This property is ignored. /// An inverted boolean value. public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture) { return !(bool)value; } } }