WPF使用Material Desgin

概述:
  本篇介绍Material Desgin组件库的使用。
   Material Desgin 时一个wpf的开源控件库。为啥会发现这个控件库,是因为再近期的WPF的项目中向封装自己的组件库,然后意外的发现了这个控件库,慨叹搜索引擎的强大。


官网地址: http://materialdesigninxaml.net/
github地址: https://github.com/MaterialDesignInXAML/MaterialDesignInXamlToolkit


实际使用:
  直接进入正题,如何使用material desgin。

  步骤一:获取material desgin库
我们要从组件库里取材料那么我们要先用库。也就是material desgin demo要有。也就是domo.(下面链接为domo)
domo:https://pan.baidu.com/s/1_S_tpxzjcNxb25ijRzlV4g
在这里插入图片描述
  
步骤二:装入VS**
在这里插入图片描述
  步骤三:写入代码
在这里插入图片描述
  代码详细:

<ResourceDictionary>
            <ResourceDictionary.MergedDictionaries>
                <ResourceDictionary Source="pack://application:,,,/MaterialDesignThemes.Wpf;component/Themes/MaterialDesignTheme.Light.xaml" />
                <ResourceDictionary Source="pack://application:,,,/MaterialDesignThemes.Wpf;component/Themes/MaterialDesignTheme.Defaults.xaml" />
                <ResourceDictionary Source="pack://application:,,,/MaterialDesignColors;component/Themes/Recommended/Primary/MaterialDesignColor.DeepPurple.xaml" />
                <ResourceDictionary Source="pack://application:,,,/MaterialDesignColors;component/Themes/Recommended/Accent/MaterialDesignColor.Lime.xaml" />
            </ResourceDictionary.MergedDictionaries>
        </ResourceDictionary>

  步骤四:窗体引用
在这里插入图片描述  步骤五:使用样式即可

猜你喜欢

转载自blog.csdn.net/weixin_41851906/article/details/103218224