StaticResource扩展未返回对资源的引用?

编程入门 行业动态 更新时间:2024-10-24 01:53:12
本文介绍了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扩展未返回对资源的引用?

本文发布于:2023-11-12 20:37:40,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1582474.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:资源   StaticResource

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!