7

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

Amit Raz
  • 5,370
  • 8
  • 36
  • 63
  • Is this still an issue? The GroupedItemsPage of the template Grid App has this construct and seems to be working fine. I noticed the OP was pre-GA but @Gabriel should be on the released version. – Jim O'Neil Jan 15 '13 at 06:29
  • I got it to work, but I don't exactly remember what was the issue. – Gabriel Jan 15 '13 at 15:45

1 Answers1

2

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.

Jared Bienz - MSFT
  • 3,550
  • 17
  • 21