开发者

wpf class library with resource dictionary

开发者 https://www.devze.com 2023-01-30 18:28 出处:网络
Is it possible to have a resource dictionary in a WPF class library assembly (.dll)? I ask this because I have an \"Application WPF\" a开发者_开发知识库ssembly (.exe), if I try to turn the type of the

Is it possible to have a resource dictionary in a WPF class library assembly (.dll)? I ask this because I have an "Application WPF" a开发者_开发知识库ssembly (.exe), if I try to turn the type of the assembly to "WPF Class Library" I get the error:

Impossible to specify the element ApplicationDefinition in the project file of the Library

How can I make it work?


You get that error because one of your XAML files has a Build Action set to ApplicationDefinition. Usually, that is App.xaml. Remove that file or change it's Build Action from Properties Window to Page to stop getting that error.


This will be the build action of one of your XAML files. I would use a WPF User Control Library or WPF Custom Control Library instead of a general class library.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号