本文介绍了StaticResource扩展未返回对资源的引用?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有一个自定义标记扩展名,我正在尝试将资源传递给它.
<ItemsControl x:Name="DataControl" ItemTemplate="{DynamicResource MessagesItemTemplate}" ItemsSource="{w:CodeBinding {StaticResource GetSlices}}" />
解决方案
我能够通过将资源添加到资源字典.这不是全局资源,因此我希望将其本地化到我的用户控件中.有什么想法为什么无法解决?
I have a custom markup extension, and I'm trying to pass a resource to it.
<ItemsControl x:Name="DataControl" ItemTemplate="{DynamicResource MessagesItemTemplate}" ItemsSource="{w:CodeBinding {StaticResource GetSlices}}" /> 解决方案 I was able to temporarily resolve the issue by adding the resource to a resource dictionary. This is NOT a global resource so I'd rather have this local to my user control. Any ideas why it wasn't resolving?更多推荐
StaticResource扩展未返回对资源的引用?
发布评论