From 5de3b2bac1ca5cc7145134fe641f0da33189aa6d Mon Sep 17 00:00:00 2001 From: Corvin <43533385+corvinsz@users.noreply.github.com> Date: Fri, 23 Oct 2026 17:02:41 +0200 Subject: [PATCH 1/3] feat(Theming): add semantic colors --- src/MainDemo.Wpf/Buttons.xaml | 8 +- src/MainDemo.Wpf/ColorTool.xaml | 6 + src/MaterialDesign3.Demo.Wpf/Buttons.xaml | 4 + src/MaterialDesign3.Demo.Wpf/ColorTool.xaml | 6 + .../SemanticColoredButtonsExample.xaml | 52 +++++ .../SemanticColoredButtonsExample.xaml.cs | 9 + .../ColorTools/SemanticColorsExamples.xaml | 198 ++++++++++++++++++ .../ColorTools/SemanticColorsExamples.xaml.cs | 20 ++ .../ResourceDictionaryExtensions.g.cs | 8 + src/MaterialDesignThemes.Wpf/Theme.g.cs | 28 +++ .../ThemeExtensions.g.cs | 8 + .../Themes/MaterialDesignTheme.Dark.xaml | 4 + .../Themes/MaterialDesignTheme.Light.xaml | 4 + .../ThemeColors.json | 36 ++++ .../WPF/Theme/ThemeTests.g.cs | 28 +++ 15 files changed, 417 insertions(+), 2 deletions(-) create mode 100644 src/MaterialDesignDemo.Shared/Examples/Buttons/SemanticColoredButtonsExample.xaml create mode 100644 src/MaterialDesignDemo.Shared/Examples/Buttons/SemanticColoredButtonsExample.xaml.cs create mode 100644 src/MaterialDesignDemo.Shared/Examples/ColorTools/SemanticColorsExamples.xaml create mode 100644 src/MaterialDesignDemo.Shared/Examples/ColorTools/SemanticColorsExamples.xaml.cs diff --git a/src/MainDemo.Wpf/Buttons.xaml b/src/MainDemo.Wpf/Buttons.xaml index c5a8b6b33f..feec76eca1 100644 --- a/src/MainDemo.Wpf/Buttons.xaml +++ b/src/MainDemo.Wpf/Buttons.xaml @@ -2,10 +2,11 @@ xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" - xmlns:sharedDomain="clr-namespace:MaterialDesignDemo.Shared.Domain;assembly=MaterialDesignDemo.Shared" xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes" xmlns:materialDesignConverters="clr-namespace:MaterialDesignThemes.Wpf.Converters;assembly=MaterialDesignThemes.Wpf" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" + xmlns:sharedDomain="clr-namespace:MaterialDesignDemo.Shared.Domain;assembly=MaterialDesignDemo.Shared" + xmlns:sharedButtons="clr-namespace:MaterialDesignDemo.Shared.Examples.Buttons;assembly=MaterialDesignDemo.Shared" xmlns:smtx="clr-namespace:ShowMeTheXAML;assembly=ShowMeTheXAML" xmlns:system="clr-namespace:System;assembly=mscorlib" d:DataContext="{d:DesignInstance sharedDomain:ButtonsViewModel}" @@ -498,6 +499,10 @@ + + + + @@ -969,7 +974,6 @@ diff --git a/src/MainDemo.Wpf/ColorTool.xaml b/src/MainDemo.Wpf/ColorTool.xaml index 582b92f14c..489423a7fa 100644 --- a/src/MainDemo.Wpf/ColorTool.xaml +++ b/src/MainDemo.Wpf/ColorTool.xaml @@ -4,6 +4,7 @@ xmlns:converters="clr-namespace:MaterialDesignDemo.Shared.Converters;assembly=MaterialDesignDemo.Shared" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:sharedDomain="clr-namespace:MaterialDesignDemo.Shared.Domain;assembly=MaterialDesignDemo.Shared" + xmlns:sharedColorTools="clr-namespace:MaterialDesignDemo.Shared.Examples.ColorTools;assembly=MaterialDesignDemo.Shared" xmlns:local="clr-namespace:MaterialDesignDemo" xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes" xmlns:materialDesignColors="clr-namespace:MaterialDesignColors;assembly=MaterialDesignColors" @@ -124,6 +125,11 @@ + + + + + diff --git a/src/MaterialDesign3.Demo.Wpf/Buttons.xaml b/src/MaterialDesign3.Demo.Wpf/Buttons.xaml index 265bb03e9b..33c84816ea 100644 --- a/src/MaterialDesign3.Demo.Wpf/Buttons.xaml +++ b/src/MaterialDesign3.Demo.Wpf/Buttons.xaml @@ -3,6 +3,7 @@ xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:sharedDomain="clr-namespace:MaterialDesignDemo.Shared.Domain;assembly=MaterialDesignDemo.Shared" + xmlns:sharedButtons="clr-namespace:MaterialDesignDemo.Shared.Examples.Buttons;assembly=MaterialDesignDemo.Shared" xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes" xmlns:materialDesignConverters="clr-namespace:MaterialDesignThemes.Wpf.Converters;assembly=MaterialDesignThemes.Wpf" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" @@ -511,6 +512,9 @@ + + + diff --git a/src/MaterialDesign3.Demo.Wpf/ColorTool.xaml b/src/MaterialDesign3.Demo.Wpf/ColorTool.xaml index 2042d4a322..7a03dff3c4 100644 --- a/src/MaterialDesign3.Demo.Wpf/ColorTool.xaml +++ b/src/MaterialDesign3.Demo.Wpf/ColorTool.xaml @@ -4,6 +4,7 @@ xmlns:converters="clr-namespace:MaterialDesignDemo.Shared.Converters;assembly=MaterialDesignDemo.Shared" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:sharedDomain="clr-namespace:MaterialDesignDemo.Shared.Domain;assembly=MaterialDesignDemo.Shared" + xmlns:sharedColorTools="clr-namespace:MaterialDesignDemo.Shared.Examples.ColorTools;assembly=MaterialDesignDemo.Shared" xmlns:local="clr-namespace:MaterialDesign3Demo" xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes" xmlns:materialDesignColors="clr-namespace:MaterialDesignColors;assembly=MaterialDesignColors" @@ -121,6 +122,11 @@ + + + + + diff --git a/src/MaterialDesignDemo.Shared/Examples/Buttons/SemanticColoredButtonsExample.xaml b/src/MaterialDesignDemo.Shared/Examples/Buttons/SemanticColoredButtonsExample.xaml new file mode 100644 index 0000000000..b4a29217c3 --- /dev/null +++ b/src/MaterialDesignDemo.Shared/Examples/Buttons/SemanticColoredButtonsExample.xaml @@ -0,0 +1,52 @@ + + + + + + + + + + +