Maximus
Maximus

Reputation: 3448

Xaml at design time

I ran into this issues endless number of times: in order to see some template, binding outcome or many more I need to run application. Is any solution to prevent running apps and be able to see result? It drives me nuts especially when it comes to see ListBoxItem's template since ListBox's binding displays no rows untill I run the whole app.

Upvotes: 1

Views: 65

Answers (1)

Chubosaurus Software
Chubosaurus Software

Reputation: 8161

Use Design-Time data :)

Usually by declaring a different DataContext at design time like so:

<Grid d:DataContext="{Binding Source={StaticResource DesignViewModel}}">

Notice the "extra" d.

SO: Dummy Design Time Data

MSDN: Maximizing the Visual Designer’s Usage with Design-Time Data

Upvotes: 2

Related Questions