Igor Kulman
Igor Kulman

Reputation: 16361

Design time data in Windows Store app

In WP7 I am used to generating sample data (XML) from my ViewModels in Blend and seeing them in Visual Studio.

In Blend 2012 I cannot find the option to generate design time data. The tempales in Visual Studio use design time data genarated in code. Is it the only way? No more XML design time data?

Upvotes: 0

Views: 809

Answers (2)

Igor Kulman
Igor Kulman

Reputation: 16361

Not possible to use design time data in XML like in WP7

Upvotes: 0

Martin Suchan
Martin Suchan

Reputation: 10620

I don't think generating design time data in Blend for VS2012 is possible, but it's still possible to use design time data created in code, but even this is more complicated than in WP7. Basically you have to use this construct in XAML to make it work:

<Page.Resources>
    <CollectionViewSource x:Name="imagesSource" Source="{Binding Model.Images}" 
        d:Source="{Binding Model.Images, Source={d:DesignInstance Type=local:MainViewModel, IsDesignTimeCreatable=True}}"/>
</Page.Resources>

The important part here is the "d:DesignInstance" and "IsDesignTimeCreatable=True", the rest is quite similar to WP7.

Upvotes: 1

Related Questions