I've set up a CompositeCollection
containing two or more collections as follows (simplified):
<Grid.Resources>
<CollectionViewSource x:Key="CollectionA" Source="{Binding CollectionA}" />
<CollectionViewSource x:Key="CollectionB" Source="{Binding CollectionB}" />
<CompositeCollection x:Key="FullCollection">
<CollectionContainer Collection="{Binding Source={StaticResource CollectionA}}" />
<CollectionContainer Collection="{Binding Source={StaticResource CollectionB}}" />
</CompositeCollection>
</Grid.Resources>
...
<ListView ItemsSource="{StaticResource FullCollection}">
<ListView.View>
<GridView>
And then some columns displayed inside the GridView
. However, I can't seem to be able to add GroupDescriptions
to the CompositeCollection
, only the individual CollectionViewSource
elements.
What I want to do is group by the collections themselves, such that the ListView
has a header, then the first collection's contents, another header, then the second collection's contents, etc.
Am I barking up the wrong tree trying to group these in this way?