为什么 Expression Blend 4 找不到全局资源库中的资源
由于此 WPF 项目的某种原因,我在 Blend 中遇到以下异常:
当一个 < code>UserControl 位于另一个 UserControl
或 Window
内。 ItemBorder
是存在于链接到应用程序 XAML 文件的资源库中的样式。我将此资源或其库移动到哪里并不重要。即使我将其直接放入正在使用它的UserControl
中,我也会收到此异常。只有当我将其设置为本地值而不是资源时,此异常才会消失。此异常仅发生在 Blend 中。它不会发生在 Visual Studio 中(我使用的是 2010),并且当我运行应用程序时也不会发生。
我已经无计可施了。这个问题意味着我完全无法使用Expression Blend。
For some reason with this WPF project, I am getting the following exception in Blend:
This happens when one UserControl
is inside another UserControl
or Window
. ItemBorder
is a style that exists in a Resource Library linked to the application XAML file. It doesn't matter where I move this resource or its library. Even if I put it directly into the UserControl
that is using it, I get this exception. Only when I make it a local value and not a resource does this exception go away. This exception only happens in Blend. It doesn't happen in Visual Studio (i'm using 2010), and it doesn't occur when I run the application.
I'm at the end of my rope here. This problem means I am completely unable to use Expression Blend.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
尝试使其成为动态资源?
我不太清楚决定静态与动态的规则,甚至给出了下面的答案,但它在加载资源以将其从静态资源更改为动态资源时为我解决了很多问题。
WPF 中的 StaticResource 和 DynamicResource 有什么区别?
好吧,经过一番挖掘,我发现了这个 。这篇文章中的OP的情况与你的情况非常相似。他的工作建议在用户控件级别合并资源字典,而不仅仅是通过 App.xaml。
Tried making it a dynamic resource?
I am not especially clear on the rules in play that determine Static vs Dynamic even give the answer below, but It has resolved a lot of issues for me when loading resources to change it from a Static to Dynamicresource.
What's the difference between StaticResource and DynamicResource in WPF?
Alright, after a little digging, I found this. The OP in this post has a situation quite similar to yours. His work around suggests merging resource dictionaries at the Usercontrol level rather than only through App.xaml.