StaticResource扩展未返回对资源的引用? [英] StaticResource extension not returning a reference to the resource?

查看:95
本文介绍了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扩展未返回对资源的引用?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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