我已将MaterialDesignThemes.Wpf.dll和MaterialDesigncolors.Wpf.dll引用到VisualStudio 2015中新创建的VSIX项目。然后我在网格标记之间添加了以下代码
<Grid.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="pack://application:,,,/MaterialDesignThemes.Wpf;component/Themes/MaterialDesignTheme.Light.xaml"></ResourceDictionary>
<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>
</Grid.Resources>
它构建成功,但在运行时我得到一个异常说,
设置属性&#39; System.Windows.ResourceDictionary.Source&#39;扔了一个 例外。内部异常无法加载文件或程序集 &#39; MaterialDesignThemes.Wpf
即使我无法添加自己的classlibrary(class1.dll)
非常感谢您对此事的帮助