using System.Globalization; using System.Windows.Data; namespace SharepointToolbox.Core.Converters; /// /// Inverts a boolean value. Used for radio button binding where /// one option is the inverse of the bound property. /// [ValueConversion(typeof(bool), typeof(bool))] public class InvertBoolConverter : IValueConverter { public object Convert(object value, Type targetType, object parameter, CultureInfo culture) => value is bool b ? !b : value; public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) => value is bool b ? !b : value; }