首页 > Windows开发 > 详细

Open-source Tutorial - Material Design for WPF UI

时间:2019-02-03 17:14:09      阅读:459      评论:0      收藏:0      [点我收藏+]

安装 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"
            [...] >

Open-source Tutorial - Material Design for WPF UI

原文:https://www.cnblogs.com/zdfffg/p/10350576.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!