类库中使用WPF 资源文件

1.类库的 后缀.csproj文件,第一个<PropertyGroup>中加入下面代码

<ProjectTypeGuids>{60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<WarningLevel>4</WarningLevel>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>

有了资源字典选项了。

 

2.引用一下三个文件和 System.xaml 文件

 

3.可以起飞了。类库是WPF扩展控件必备项目类型

posted @ 2018-11-27 16:50  Index_Zero  阅读(1425)  评论(0编辑  收藏  举报