Hari Subramaniam
Hari Subramaniam

Reputation: 1876

WPF MVVM XAML design - VS 2010 XAML designer - Design time data

We are in the process of developing a WPF app. We have entrusted the development of the Views to designers who would use VS 2010 XAML designer to design. We have gone in for MVVM pattern. We are expecting the XAMl designers to design the Screens/Views and based on the screens we will start constructing the ViewModel. But the designers are having a problem viewing the layout of views without design time data. Is there a way to solve this?

Upvotes: 0

Views: 1323

Answers (2)

Paolo Moretti
Paolo Moretti

Reputation: 56024

You can follow this guides:

You start adding the following namespace declarations to your XAML files:

mc:Ignorable="d" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"

The you can set properties and attributes that are ignored at runtime.

For example, d:DataContext gives you the ability to set a design time d:DataContext that is separate and independent from the run-time DataContext property.

Upvotes: 1

Danny Varod
Danny Varod

Reputation: 18118

First of all, give the designers Microsoft Expression Blend, not Visual Studio. That is what it is meant for.

Second of all, in Blend, designers can create fictive data for displaying, however, since the data types (the view models) are not defined yet, they can edit the views and data templates without data.

Also, try searching in Google for: expression blend sample data
- you will receive a lot of relevant results.

Upvotes: 0

Related Questions