在一个很大的控件库上工作的generic.xaml会使simpy失去控制。我想通过控制对其进行拆分(尽管对于一个仅包含一些简单 namespace 的 namespace 来说,这一次)。
为此,我要添加更多的资源字典。
然后,在generic.Xaml中添加:
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="Themes/Generic.Core.xaml" />
</ResourceDictionary.MergedDictionaries>
还有...出现加载错误。
什么是正确的网址?
这是:
我阅读了有关包URL的MSDN部分,但对于看起来如此简单的东西来说,听起来确实很复杂。
;) 请帮忙。
最佳答案
找到了:
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="/Tradex.Presentation;component/Themes/Generic.Core.xaml" />
</ResourceDictionary.MergedDictionaries>
那个有效。
需要给程序集加上前缀(用程序集名称替换
Tradex.Presentation
),并从component
项开始。
关于wpf - 拆分Generic.Xaml-加载MergedDictionaries时出现问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3296834/