Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/wpf/14.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Wpf dll中的全局数据模板_Wpf_Resources_Datatemplate - Fatal编程技术网

Wpf dll中的全局数据模板

Wpf dll中的全局数据模板,wpf,resources,datatemplate,Wpf,Resources,Datatemplate,延长以下问题: 我将DataTemplate移动到全局定义的DataTemplate中。但定义的外观从未出现 我想我找到了原因,整个项目是一个dll。而且App.xaml永远不会被调用 <ResourceDictionary> <ResourceDictionary.MergedDictionaries> <ResourceDictionary Source="/MyProject;component/Styles/LookAndFee

延长以下问题:

我将DataTemplate移动到全局定义的DataTemplate中。但定义的外观从未出现

我想我找到了原因,整个项目是一个dll。而且App.xaml永远不会被调用

<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。出色的分析。你能帮我解决问题吗?