views:

89

answers:

2

I have some ListBoxes in my WPF app. I would like to be able to view how the design looks with out having to run the app.

But I still want to be able to bind to ItemsSource to my View Model.

I know I saw a blog post on how to do this, but I cannot seem to find it now.

To reiterate, I want dummy data at design time, but real data at run time and not break the MVVM pattern.

Any ideas?

A: 

You can check whether your code is in design mode or not. Here's a great post about doing this in different situation.

Detecting design time mode in WPF and Silverlight

Matt Casto
A: 

Have you tried the sample data option in Blend 3? With a control open, look at the DATA tool window. There's a way to create sample data... think it does exactly what you're looking for:

http://silverzine.com/tutorials/how-to-create-sample-data-in-blend-3/

AC