MVVM Light + Blend designer view error: Cannot find resource named 'Locator'.

后端 未结 7 1323
[愿得一人]
[愿得一人] 2020-12-14 09:31

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

It says Cannot find resource named \'Locator\'. Obviously, i did not change anything i

7条回答
  •  孤城傲影
    2020-12-14 10:05

    There are two known occurrences where this can happen.

    • 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.

    • 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.

    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.

    What you can do is

    • 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).

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

    Hopefully this helps,

    Laurent

提交回复
热议问题