using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows.Data; namespace Tango.SharedUI.Converters { /// /// Represents a binding converter for reversing a boolean value. /// /// public class BooleanInverseConverter : IValueConverter { /// /// Converts a value. /// /// The value produced by the binding source. /// The type of the binding target property. /// The converter parameter to use. /// The culture to use in the converter. /// /// A converted value. If the method returns null, the valid null value is used. /// public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture) { return !(bool)value; } /// /// Converts a value. /// /// The value that is produced by the binding target. /// The type to convert to. /// The converter parameter to use. /// The culture to use in the converter. /// /// A converted value. If the method returns null, the valid null value is used. /// public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture) { return !(bool)value; } } }