c# - 如何制作 MaterialDesignInXamlToolkit 自定义颜色主题?

标签 c# xaml material-design-in-xaml

我必须制作一个带有自定义口音和主要调色板的个人 colot 主题。

是否可以使用新的自定义调色板在我的项目中创建资源字典?

你能给我看一个 sample 吗?

最好的问候

佛朗哥

最佳答案

要创建自定义调色板,请在 App.xaml 中手动定义画笔,例如:

<!-- 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"/>

在此示例中,您不会合并颜色程序集中的两个调色板。

有关详细信息,请参阅:

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

关于c# - 如何制作 MaterialDesignInXamlToolkit 自定义颜色主题?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40101956/

相关文章:

wpf - 为什么绑定(bind) TextBlock 文本属性不能按预期工作

c# - WPF 绑定(bind) : Set Listbox Item text color based on property

wpf - 如何设置实时图表的标签颜色?

c# - "Type ' http ://www. w3.org/2000/09/xmldsig# :SignatureType ' is not declared" in XmlDocument. 验证(...)

c# - 方法内的临时方法?

c# - 通用约束 : Enforce type to have static function and constructor with parameters

c# - C#解析XML数据并显示到ListBox

c# - 依赖属性更改时 StackPanel 可见性未更新

c# - 对话框 XAML 和 Material 设计 WPF

wpf - Material 设计 xaml 不同窗口/控件的不同主题/调色板