views:

13

answers:

1

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. Anybody run across this issue?

+2  A: 

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.

AnthonyWJones
Thanks, that worked once I found where the web service calls were failing. The error message isn't very specific.
Bryan