Open-source Tutorial - Material Design for WPF UI
2024-09-04 21:43:11
安装 Material Design Themes
通过 NuGet 包管理器搜索自动安装
通过 NuGet 包管理器控制台手动安装
Install-Package MaterialDesignThemes
配置 App.xaml
主题
对于 Light 主题(二选一):
< ResourceDictionary Source = “ pack:// application:,,, / MaterialDesignThemes.Wpf; component / Themes / MaterialDesignTheme.Light.xaml ” />
对于 Dark 主题(二选一):
< ResourceDictionary Source = “ pack:// application:,,, / MaterialDesignThemes.Wpf; component / Themes / MaterialDesignTheme.Dark.xaml ” />
默认
< ResourceDictionary Source = “ pack:// application:,,, / MaterialDesignThemes.Wpf; component / Themes / MaterialDesignTheme.Defaults.xaml ” />
颜色
< ResourceDictionary Source = “ pack:// application:,,, / MaterialDesignColors; component / Themes / Recommended / Primary / MaterialDesignColor.COLOR_NAME.xaml ” />
< ResourceDictionary Source = “ pack:// application:,,, / MaterialDesignColors; component / Themes / Recommended / Accent / MaterialDesignColor.COLOR_NAME.xaml ” />
配置窗体
基础配置
<Window [...]
TextElement.Foreground="{DynamicResource MaterialDesignBody}"
Background="{DynamicResource MaterialDesignPaper}"
[...] >
完整配置
<Window [...]
TextElement.Foreground="{DynamicResource MaterialDesignBody}"
Background="{DynamicResource MaterialDesignPaper}"
TextElement.FontWeight="Medium"
TextElement.FontSize="14"
FontFamily="pack://application:,,,/MaterialDesignThemes.Wpf;component/Resources/Roboto/#Roboto"
[...] >
最新文章
- css(二)
- Django HTML 显示文章摘要
- C++11之thread线程
- 牢骚与javascript中的this
- phpcms 04
- [SAP ABAP开发技术总结]增强Enhancement
- iOS 国际化
- 第03篇. 标准Web项目Jetty9内嵌API简单启动
- java学习系列(一)Java中的IO操作
- PHP缓存技术的多种方法小结
- Centos7下用FastDFS搭建图片服务器
- 前端js日期时间格式转换
- RabbitMQ持久化
- windows生成当前目录树
- java 遍历Map的4种方法
- [Vijos 1676] 陶陶吃苹果
- php reids 单机命令
- ES6-循环
- Python 模块 re (Regular Expression)
- GraphicsMagick 1.3.25 Linux安装部署