0

I have a wpf application project, with user controls in a separate project. I'd like to have different resource dictionaries in the different projects When I view the user controls from the user control project, I'd like to use the user control library's dictionary. when I run the Application, i'd like to use the application's dictionary. Right now, when i run the application, the application still has it's own dictionary, but the user controls are still using the user control library's dictionary I've tried combinations of dictionaries and merged dictionaries. Not really sure how to do this. thanks in advace

4

1 回答 1

0

所以我找到了一个解决方法:在用户控件库中包含一个 App.xaml 文件。在用户控件 App.xaml 文件中定义用户控件设计时资源 在常规 wpf 应用程序项目中,包括运行时资源。在设计时,用户控件只看到自己的 App.xaml 文件,而在运行时,应用程序运行并使用应用程序项目 App.xaml 文件中定义的资源 不知道这是否是最佳方法这个。如果有人对这种方式有任何意见,请随时发表谢谢

于 2013-05-27T06:29:23.000 回答