From 279120303d2da79534739f04a59a667e7371460e Mon Sep 17 00:00:00 2001 From: Kevin Bost Date: Thu, 9 Apr 2026 23:31:42 -0700 Subject: [PATCH] DynamicColorTool: improve layout and update demo defaults - Removes the ScrollViewer from the main layout of DynamicColorTool. - Sets the navigation drawer to be closed by default in the demo application. - Modernizes collection initialization in DynamicColorToolViewModel using collection expressions. - Adjusts the Z-order and hit testing for the copy color button in the color tiles to improve interaction. --- .../Domain/DynamicColorToolViewModel.cs | 4 +- .../DynamicColorTool.xaml | 527 +++++++++--------- src/MaterialDesign3.Demo.Wpf/MainWindow.xaml | 2 +- 3 files changed, 265 insertions(+), 268 deletions(-) diff --git a/src/MaterialDesign3.Demo.Wpf/Domain/DynamicColorToolViewModel.cs b/src/MaterialDesign3.Demo.Wpf/Domain/DynamicColorToolViewModel.cs index 886b7ef304..fc00289e7a 100644 --- a/src/MaterialDesign3.Demo.Wpf/Domain/DynamicColorToolViewModel.cs +++ b/src/MaterialDesign3.Demo.Wpf/Domain/DynamicColorToolViewModel.cs @@ -369,13 +369,13 @@ public IReadOnlyList CustomTonalPaletteTiles { get; private set => SetProperty(ref field, value); - } = Array.Empty(); + } = []; public IReadOnlyList CustomSemanticColorTiles { get; private set => SetProperty(ref field, value); - } = Array.Empty(); + } = []; public Brush PrimaryBrush => CreateBrush(PrimaryColor); diff --git a/src/MaterialDesign3.Demo.Wpf/DynamicColorTool.xaml b/src/MaterialDesign3.Demo.Wpf/DynamicColorTool.xaml index 1ec9dd391e..9eba724e84 100644 --- a/src/MaterialDesign3.Demo.Wpf/DynamicColorTool.xaml +++ b/src/MaterialDesign3.Demo.Wpf/DynamicColorTool.xaml @@ -45,18 +45,6 @@ Background="{Binding BackgroundBrush}" CornerRadius="8"> - - + + @@ -76,195 +75,194 @@ - - - - - - - - - - - - + + + + + + + + + + - - - - - + - - - - + - - - - - - - + + + + + - - - + + - - - + - - - - + - - - - - - - + + + + + - - - + + - - - + - - - - + - - - - - - - + + + + + - - - - + + + - - - - - - - - - + + + + + + + - - - - - - - - - - - - - - - + + + + + + + + + + + + - - - - - - - - + + + + + - - - - + + - - - - + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + - - - - - - - - - - - - - - + + + + + + + + + + + + - - - - + - - - - - - - - - - - + + + + + + + - - - - - - - - + + + + + + + + - - - - - - - - - + + + diff --git a/src/MaterialDesign3.Demo.Wpf/MainWindow.xaml b/src/MaterialDesign3.Demo.Wpf/MainWindow.xaml index 179c064e3e..cbbb00b325 100644 --- a/src/MaterialDesign3.Demo.Wpf/MainWindow.xaml +++ b/src/MaterialDesign3.Demo.Wpf/MainWindow.xaml @@ -166,7 +166,7 @@ Margin="5,0,24,0" AutomationProperties.Name="HamburgerToggleButton" Click="MenuToggleButton_OnClick" - IsChecked="True" + IsChecked="False" Style="{StaticResource MaterialDesignHamburgerToggleButton}" />