CollectionViewSource, Design Time Data, Blend and Windows 8
Asked Answered
M

1

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

Mycenae answered 2/5, 2012 at 8:20 Comment(2)
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.Grape
I got it to work, but I don't exactly remember what was the issue.Latton
B
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.

Brattice answered 22/1, 2013 at 19:5 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.