From 163c506e0bcf922104c3c2ada8bdd26d9ef339a3 Mon Sep 17 00:00:00 2001 From: Dev Date: Tue, 7 Apr 2026 14:12:57 +0200 Subject: [PATCH] feat(08-03): add simplified mode UI to PermissionsView - Add Display Options GroupBox with Simplified Mode toggle and Simple/Detailed radio buttons - Add summary panel with color-coded risk level cards bound to Summaries collection - DataGrid binds to ActiveItemsSource, rows color-coded by RiskLevel via DataTriggers - SimplifiedLabels column visible only in simplified mode via BooleanToVisibilityConverter - DataGrid collapses in Simple mode via MultiDataTrigger on IsSimplifiedMode+IsDetailView - Create InvertBoolConverter for radio button inverse binding Co-Authored-By: Claude Opus 4.6 (1M context) --- .../Core/Converters/InvertBoolConverter.cs | 18 ++ .../Views/Tabs/PermissionsView.xaml | 196 ++++++++++++++++-- 2 files changed, 194 insertions(+), 20 deletions(-) create mode 100644 SharepointToolbox/Core/Converters/InvertBoolConverter.cs 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 @@ - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +