I am trying to sort my CollectionViewSource. I have tried SortDescriptions, , however it gives an unknown member error(even after adding references)
<common:LayoutAwarePage.Resources>
<common:BooleanToVisibilityConverter x:Key="BooleanToVisibilityConverter"/>
<!--
Collection of grouped items displayed by this page, bound to a set
of the complete item list because items in groups cannot be virtualized
-->
<!--Replace d:Source... with the following to obtain data from the actual Azure Service-->
<!--Source="{Binding ItemGroups, Source={d:DesignInstance IsDesignTimeCreatable=True, Type=ViewModels:ItemsShowcaseViewModel}}"-->
<CollectionViewSource
x:Name="groupedItemsViewSource"
Source="{Binding ItemGroups}"
d:Source="{Binding ItemGroups, Source={d:DesignInstance IsDesignTimeCreatable=True, Type=sampleData:ItemsShowcaseSampleData}}" IsSourceGrouped="True"
>
</CollectionViewSource>
</common:LayoutAwarePage.Resources>
Sorting isn't built into CollectionViewSource
in WinRT/XAML. You need to sort your data in your data/view-model.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.