using System; using System.Globalization; using System.Windows.Data; namespace ThreadPilot.Converters { /// /// Converter to invert boolean values /// public class InverseBooleanConverter : IValueConverter { public static readonly InverseBooleanConverter Instance = new(); public object Convert(object value, Type targetType, object parameter, CultureInfo culture) { if (value is bool boolValue) { return !boolValue; } return true; } public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) { if (value is bool boolValue) { return !boolValue; } return false; } } }