Ray
Ray

Reputation: 4947

XAML designer in visual studio cannot display anything

Why is it that every time I open a user control or anything a little more complicated than simple markup, Visual studio is unable to display it in the designer? Sometimes I have a form where there are several elements, but all the designer displays is a rectangle? How does one work on more complicated pages with XAML?

Upvotes: 2

Views: 1274

Answers (2)

NielW
NielW

Reputation: 3774

In my experience, Visual Studio's designer is almost completely useless for anything more complicated than the simplest designs. Have you tried using Blend? It actually works (most of the time.)

Upvotes: 2

Youngjae
Youngjae

Reputation: 25080

If you use Binding in XAML, VS designer invokes the binded object as a compiled manner like part of your program being executed. At this time, if the binded object does not prepare any fake data programatically which gives null in general, VS designer is failed to render UI because it is treated as NullReferenceException during rendering process.

Those fake data is called design-time data in XAML. To prepare design-time fake data for UI, please check this link: https://stackoverflow.com/a/11561369/361100

Upvotes: 2

Related Questions