MVVM Light + Blend设计器视图错误:找不到名为"Locator"的资源. [英] MVVM Light + Blend designer view error: Cannot find resource named 'Locator'.

查看:105
本文介绍了MVVM Light + Blend设计器视图错误:找不到名为"Locator"的资源.的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

该应用程序运行正常,但在设计器视图中看不到我的设计.

The application runs fine but i could not see my design in the designer view.

它说找不到名为"Locator"的资源.显然,我没有更改代码中的任何内容,只是使用数据绑定对话框进行了数据绑定...

It says Cannot find resource named 'Locator'. Obviously, i did not change anything in the code, i just did the data binding using the data binding dialog...

有人遇到同样的问题吗?

anyone facing the same problem?

推荐答案

有两种已知的情况可能发生.

There are two known occurrences where this can happen.

  • 如果在构建应用程序之前更改为Blend,则DLL尚不可用,并且可以看到此错误.构建应用程序可以解决问题.

  • If you change to Blend before you built the application, the DLLs are not available yet and this error can be seen. Building the application solves the issue.

Expression Blend中存在一个错误,如果您将用户控件放置在另一个用户控件(或WPF中的Window)中,并且内部用户控件使用全局资源,则找不到全局资源.在这种情况下,您也会收到错误消息.

There is a bug in Expression Blend where, if you are placing a user control in another user control (or Window in WPF), and the inner user control uses a global resource, the global resource cannot be found. In that case you will get the error too.

不幸的是,我没有第二点的解决方法,因为它是一个Blend错误.我希望我们能尽快找到解决方案,但在Blend 4中它似乎仍然存在.

Unfortunately I do not have a workaround for the second point, as it is a Blend bug. I hope we will see a resolution for that soon, but it seems to be still there in Blend 4.

你能做的是

  • 在使用外部用户控件时忽略该错误.当您使用内部用户控件时,应该会看到设计时数据很好(我不太满意).

  • Ignore the error when working on the outer user control. When you work on the inner user control, you should see the design time data fine (not very satisfying I know).

使用d:DataContext临时在Blend中设置设计时间数据上下文.

Use the d:DataContext to set the design time data context in Blend temporarily.

希望这会有所帮助,

洛朗

这篇关于MVVM Light + Blend设计器视图错误:找不到名为"Locator"的资源.的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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