WPF: Sharing resources across assemblies

南笙酒味 提交于 2019-12-04 06:44:01

问题


I previously posted a question on sharing resources across assemblies using Themes/generic.xaml and the ComponentResourceKey markup extension. The solution works nicely, but it requres all of the shared resources to be located in the generic.xaml resource dictionary. Mine is getting rather large, so I thought I would use merged dictionaries in generic.xaml to organize things.

I have had no luck so far. I ran some tests using the demo from my previous post, and as soon as I move resources to a merged dictionary, the ComponentResourceKey fails, complaining that it can't find the source file for the merged dictionary.

Has anyone else gotten this working? How? Thanks for your help.


回答1:


You could use WPF Resource Dictionary in a separate assembly



来源:https://stackoverflow.com/questions/2095031/wpf-sharing-resources-across-assemblies

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!