Amit Raz
Amit Raz

Reputation: 5536

CollectionViewSource, Design Time Data, Blend and Windows 8

I have a problem in showing Design Time data in blend here is my code This is my collection view source:

 <CollectionViewSource
        x:Name="DataSource"
        Source="{Binding Groups}"
        IsSourceGrouped="true"
        ItemsPath="Items"
        d:Source="{Binding ItemGroups, Source={d:DesignInstance Type=data:SampleData, IsDesignTimeCreatable=True}}"/>

And the Grid View that uses it:

<GridView
                x:Name="itemGridView"                   
                ItemsSource="{Binding Source={StaticResource DataSource}}"

My problem is that I am seeing the design time data only in VS11 but Not in Blend. Why is that?

Thanks

Upvotes: 7

Views: 1388

Answers (1)

Jared Bienz - MSFT
Jared Bienz - MSFT

Reputation: 3550

The answer depends on how you're instantiating your design-time data. It seems you might have been using a ViewModel? If so, check at what point you create it. e.g. are you creating it as an element in your XAML or are you creating it in the constructor of the view?

Really there should not be a difference in what you see at design time in Visual Studio vs what you see at design time in Expression Blend. If there is, you may need to do a clean and rebuild of the project in one of the programs. If the problem still persists, try closing Blend and reopening it.

Upvotes: 2

Related Questions