是否可以共享多个项目之间的ResourceDictionary文件? [英] Is it possible to share a ResourceDictionary file between multiple projects?

查看:1438
本文介绍了是否可以共享多个项目之间的ResourceDictionary文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果我在一个项目有一个ResourceDictionary中,是否有可能创建一个使用在第一个项目定义的资源另一个项目?请注意,这两个项目都是WPF应用程序,而不是ControlLibraries。

If I have a ResourceDictionary in one project, is it possible to create another project that uses resources defined in the first project? Note that both projects are WPF Applications, not ControlLibraries.

谢谢!

推荐答案

是的,当然这是可能的,只要项目b的项目A的引用

Yes, of course that's possible, as long as Project B has a reference to Project A.

<ResourceDictionary.MergedDictionaries>
    <ResourceDictionary Source="/Project A;component/YourSubFolder/YourResourceFile.xaml" />
</ResourceDictionary.MergedDictionaries>



然后,你可以使用YourResourceFile.xaml定义的资源。

Then you can just use the Resources defined in YourResourceFile.xaml.

这篇关于是否可以共享多个项目之间的ResourceDictionary文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆