在 WinRT 中创建排序集合视图 [英] Creating a Sorted Collection View in WinRT
问题描述
有没有人尝试过创建一个对集合进行排序的视图?ICollectionView 接口是存在的,它声称与它的 WPF/SL 对应物(排序、分页、过滤)具有相同的职责,但是,除非我遗漏了什么,没有排序接口上的方法/属性.
Has anyone had a go at creating a view that sorts a collection? The ICollectionView interface is present, and it claims to have the same responsibilities as its WPF / SL counterpart (sorting, paging, filtering), however, unless I have missed something, there are no sort methods / properties on the interface.
我有兴趣了解如何获取一组项目,然后通过 WinRT 中的视图对它们进行排序.
I would be interested to find out how to take a collection of items then sort them via a view in WinRT.
请注意,我知道我可以手动执行此操作,但是,我想查看已排序的集合如何与在执行排序时添加视觉效果的 WinRT 主题转换进行交互.
Note, I know I can do this manually, however, I want to see how a sorted collection interacts with the WinRT theme transitions that appear to add visual effects when sorting is performed.
推荐答案
遗憾的是,Win8 不支持对集合视图进行排序(也不支持过滤或分组).唯一的办法就是直接操作数据源,然后赋值给Source属性.
Unfortunately, there's no support for sorting a collection view in Win8 (nor filtering or grouping). The only way to do this is to manipulate the data source directly, then assign it to Source property.
这已被讨论为对后 Win8 时间框架的改进.希望我有更好的消息:)
This has been discussed as an improvement for the post-Win8 timeframe. Wish I had better news :)
这篇关于在 WinRT 中创建排序集合视图的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!