Filtering and Sorting of an ObservableCollection in ListView-Binding

后端 未结 2 561
夕颜
夕颜 2021-01-23 05:09

In earlier Versions of .net you could use something like

ICollectionView collectionView = CollectionViewSource.GetDefaultView(AllImages);

To bu

相关标签:
2条回答
  • 2021-01-23 05:28

    As you'd figured out the CollectionViewSource doesn't have support for filters or sorts in WinRT/XAML. Your solution is then to sort the contents of the associated ObservableCollection.

    0 讨论(0)
  • 2021-01-23 05:50

    There is a custom ICollectionView implementation available on CodeProject that adds the functionality of sorting/filtering. Here is a link to the article/code: http://www.codeproject.com/Articles/527686/A-WinRT-CollectionView-class-with-Filtering-and-So

    This will bring back some of the functionality that is missing in the WinRT version of ICollectionView. Hopefully this will help someone who comes across this question as I did, looking for the ability to filter a collection.

    0 讨论(0)
提交回复
热议问题