diff --git a/SharepointToolbox/Core/Converters/InvertBoolConverter.cs b/SharepointToolbox/Core/Converters/InvertBoolConverter.cs new file mode 100644 index 0000000..d465ab4 --- /dev/null +++ b/SharepointToolbox/Core/Converters/InvertBoolConverter.cs @@ -0,0 +1,18 @@ +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; +} diff --git a/SharepointToolbox/Views/Tabs/PermissionsView.xaml b/SharepointToolbox/Views/Tabs/PermissionsView.xaml index 947f613..55862ee 100644 --- a/SharepointToolbox/Views/Tabs/PermissionsView.xaml +++ b/SharepointToolbox/Views/Tabs/PermissionsView.xaml @@ -1,7 +1,15 @@ + xmlns:loc="clr-namespace:SharepointToolbox.Localization" + xmlns:models="clr-namespace:SharepointToolbox.Core.Models" + xmlns:converters="clr-namespace:SharepointToolbox.Core.Converters"> + + + + + + @@ -55,6 +63,41 @@ + + + + + + + + + + + + + + + + + + + @@ -89,25 +132,138 @@ - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +