Wpf dll中的全局数据模板
延长以下问题: 我将DataTemplate移动到全局定义的DataTemplate中。但定义的外观从未出现 我想我找到了原因,整个项目是一个dll。而且App.xaml永远不会被调用Wpf dll中的全局数据模板,wpf,resources,datatemplate,Wpf,Resources,Datatemplate,延长以下问题: 我将DataTemplate移动到全局定义的DataTemplate中。但定义的外观从未出现 我想我找到了原因,整个项目是一个dll。而且App.xaml永远不会被调用 <ResourceDictionary> <ResourceDictionary.MergedDictionaries> <ResourceDictionary Source="/MyProject;component/Styles/LookAndFee
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="/MyProject;component/Styles/LookAndFeel.xaml" />
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
是第一步(App.xaml)
LookAndFeel.xaml包含指向数据模板的“链接”:
<ResourceDictionary Source="/MyProject;component/MySubFolder/MyDataTemplate.xaml" />
没有生成错误,应用程序启动正常,但从未使用DataTemplate中定义的布局
只是为了验证,这不是定义问题,我将DataTemplate复制到UserControl.Resources中-工作正常
但我如何从全球范围来定义它呢
提前感谢如果没有引用App.xaml,将不会使用带有DataTemplate的ResourceDictionary。出色的分析。你能帮我解决问题吗?