Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

like image 639
Amit Raz Avatar asked May 02 '12 08:05

Amit Raz


1 Answers

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.

like image 145
Jared Bienz - MSFT Avatar answered Sep 22 '22 07:09

Jared Bienz - MSFT