Prism.Dryioc
![](https://img-blog.csdnimg.cn/img_convert/87d601dc9497ba69d2d84c98c37e2fb8.png)
输入Prism.Dryioc
![](https://img-blog.csdnimg.cn/img_convert/461b4b3701de563e07f4015e574ebf98.png)
MaterialDesign
![](https://img-blog.csdnimg.cn/img_convert/e923d4dae17d6406c0cef67be613029d.png)
改App.xaml
<prism:PrismApplication x:Class="MyToDo2.App"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:MyToDo2"
xmlns:prism ="http://prismlibrary.com/"
StartupUri="MainWindow.xaml">
<Application.Resources>
</Application.Resources>
</prism:PrismApplication>
![](https://img-blog.csdnimg.cn/img_convert/6a1972ba345d73a34ef9ecbfd8d7df29.png)
右按键,查看代码
![](https://img-blog.csdnimg.cn/img_convert/de7a5a707a7c9891c9cf05ddf4aeab3a.png)
改App.xaml.cs
![](https://img-blog.csdnimg.cn/img_convert/a2765ce3816cddd1e8e304d3616b8e61.png)
引资源
![](https://img-blog.csdnimg.cn/img_convert/44ed7d2ea229aea4739873178dc32e27.png)
<prism:PrismApplication x:Class="MyToDo2.App"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:MyToDo2"
xmlns:prism ="http://prismlibrary.com/"
xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
StartupUri="MainWindow.xaml">
<Application.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<materialDesign:BundledTheme BaseTheme="Light" PrimaryColor="DeepPurple" SecondaryColor="Lime" />
<ResourceDictionary Source="pack://application:,,,/MaterialDesignThemes.Wpf;component/Themes/MaterialDesignTheme.Defaults.xaml" />
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
</Application.Resources>
</prism:PrismApplication>
删除StartupUri
![](https://img-blog.csdnimg.cn/img_convert/b17386d712447b46a795ac3078c3d34d.png)
因为有了设置启动
![](https://img-blog.csdnimg.cn/img_convert/c8e4dde752c7dd7d426d11fb010dbcd9.png)
效果
没有设置按钮颜色,但有蓝色,说明MaterialDesign主题起效了。
![](https://img-blog.csdnimg.cn/img_convert/b3b2fca905309d2379863b654fc9a70e.png)