我们有两个 CollectionViewSource
<CollectionViewSource
x:Name="groupedItemsViewSource"
Source="{Binding CategoryData}"
IsSourceGrouped="true"
ItemsPath="TopItemsQuestionData"
d:Source="{Binding AllCategory, Source={d:DesignInstance Type=data:DataSource, IsDesignTimeCreatable=True}}"/>
<CollectionViewSource
x:Name="groupedItemsViewSourcePOI"
Source="{Binding CategoryData}"
IsSourceGrouped="true"
ItemsPath="TopItemsQuestionDataPOI"
d:Source="{Binding AllCategory, Source={d:DesignInstance Type=data:DataSource, IsDesignTimeCreatable=True}}"/>
我们想将这两个 CollectionViewSource 绑定(bind)到此 Data GridView
<GridView
...
ItemsSource="{Binding Source={StaticResource groupedItemsViewSourcePOI}}"
当然,必须在此 ItemSource 上进行绑定(bind)。 问题是 ItemSource 一次只接受一个“绑定(bind)源”,我们希望将其链接到我们的两个 CollectionViewSource。有没有机会将它们联系在一起? 预先感谢您
最佳答案
您应该使用通用类型(可能是概括您的集合的抽象类)并将其绑定(bind)到 GridView
关于c# - 如何将 2 个 CollectionViewSource 绑定(bind)到 GridView,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17132771/