I'm getting the above error when trying to load a User Control xaml file in design view in Expression Blend 4. The xaml itself runs successfully in VS 2010, and I can view the xaml in blend, but not in design view. When viewing the xaml in 'xaml view' the UserControl element is underlined in red. A开发者_JS百科nybody run across this issue?
You have to remember that in order to render a control the designer will have to execute some of its code. If the code it runs does things (like make WCF calls) that the design context doesn't support then you can have problems.
For this reason the Silverlight API contains the DesignerProperties
class in the System.ComponentModel
namespace. Use its static IsInDesignTool
property to skip/mock code that runs during control loading that can't be supported in a designer.
精彩评论