-
Hello, <ResourceDictionary.MergedDictionaries>
<!-- Customized Material Design Theme -->
<materialDesign:CustomColorTheme
BaseTheme="Light"
PrimaryColor="#0B6EC7"
SecondaryColor="#0CABC7" />
<!-- Material Design Theme -->
<ResourceDictionary Source="pack://application:,,,/MaterialDesignThemes.Wpf;component/Themes/MaterialDesign3.Defaults.xaml" />
</ResourceDictionary.MergedDictionaries> However, I would like to have control over the hues and customize them as shown in Wiki > Theming > Custom Palette Hues. <ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<!-- I need to replace it with the ResourceDictionary instance with the brushes automatically setup -->
<ResourceDictionary Source="pack://application:,,,/MaterialDesignColors;component/Themes/MaterialDesignColor.Indigo.Primary.xaml" />
</ResourceDictionary.MergedDictionaries>
<SolidColorBrush x:Key="MaterialDesign.Brush.Primary.Light" Color="{StaticResource Primary200}"/>
<SolidColorBrush x:Key="MaterialDesign.Brush.Primary.Light.Foreground" Color="{StaticResource Primary200Foreground}"/>
<SolidColorBrush x:Key="MaterialDesign.Brush.Primary" Color="{StaticResource Primary500}"/>
<SolidColorBrush x:Key="MaterialDesign.Brush.Primary.Foreground" Color="{StaticResource Primary500Foreground}"/>
<SolidColorBrush x:Key="MaterialDesign.Brush.Primary.Dark" Color="{StaticResource Primary700}"/>
<SolidColorBrush x:Key="MaterialDesign.Brush.Primary.Dark.Foreground" Color="{StaticResource Primary700Foreground}"/>
</ResourceDictionary>
|
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
@97gg yes, though you will need to do it in C# rather than in XAML. |
Beta Was this translation helpful? Give feedback.
-
Thank you very much |
Beta Was this translation helpful? Give feedback.
@97gg yes, though you will need to do it in C# rather than in XAML.
What you want to do is leverage the
PaletteHelper.GetTheme()
or more genericallyResourceDictionaryExtensions.GetTheme()
extension method. These methods will return back the currentTheme
object. This class has all of the theme colors and you can then make any modifications to them that you wish. Once you are done, to apply the updated theme, you will need to callPaletteHelper.SetTheme()
orResourceDictionaryExtensions.SetTheme()
. These methods will set the XAML resources.