How make MaterialDesignInXamlToolkit Custom Color Theme?

眉间皱痕 提交于 2019-12-10 10:11:00

问题


I have to make a personal colot theme with custom accent and primary color palette.

Is possible to create a resource dictonary in my project with new custom palette?

Can you show me a sample?

Best Regards

Franco


回答1:


To create a custom palette, define your brushes manually in your App.xaml e.g.:

<!-- primary hues  -->
<SolidColorBrush x:Key="PrimaryHueLightBrush" Color="LightBlue"/>
<SolidColorBrush x:Key="PrimaryHueLightForegroundBrush" Color="Black"/>
<SolidColorBrush x:Key="PrimaryHueMidBrush" Color="Blue"/>
<SolidColorBrush x:Key="PrimaryHueMidForegroundBrush" Color="White"/>
<SolidColorBrush x:Key="PrimaryHueDarkBrush" Color="DarkBlue"/>
<SolidColorBrush x:Key="PrimaryHueDarkForegroundBrush" Color="White"/>
<!--  accent -->
<SolidColorBrush x:Key="SecondaryAccentBrush" Color="Yellow"/>
<SolidColorBrush x:Key="SecondaryAccentForegroundBrush" Color="Black"/>

In this example you wouldn't merge in your two palettes from the Colors assembly.

For more information see:

https://github.com/ButchersBoy/MaterialDesignInXamlToolkit/wiki/Custom-Palette-Hues



来源:https://stackoverflow.com/questions/40101956/how-make-materialdesigninxamltoolkit-custom-color-theme

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!