c# - ListCollectionView.CustomSort 是否使用稳定的排序?
问题描述
我使用 ListCollectionView 和 Comparer 对 xaml 中的列表进行排序,而在 C# 的另一个位置,我需要使用相同的 Comparer 以完全相同的方式进行排序,因此排序需要稳定。
这种排序是不稳定的:
myCollectionCopy = myCollection.ToList();
myCollectionCopy.Sort(myComparer);
这种排序是稳定的:
myCollection.OrderBy(x => x.MyProperty, myComparer)
但是我无法从文档中弄清楚 ListCollectionView 在设置时是否使用了稳定的排序
myListCollectionView.CustomSort = myComparer;
解决方案
推荐阅读
- amazon-s3 - AWS S3 Presign URL 生成抛出 409 Conflicting Conditional Operation Exception
- javascript - 为什么 iframe DOM 操作可以从 Chrome 开发控制台工作,而不是直接加载 JS
- javascript - 使用敲除的字段验证
- linux - Yocto项目中image文件夹下的文件说明及Yocto linux的启动顺序
- python - Python子进程:向编辑器发送信件不起作用
- javascript - Azure DevOps WebExtension 使用 WebWorker
- python - pd .cut 间隔的令人困惑的结果
- javascript - antd: Select 组件的 'inputValue' 属性不起作用
- r - R group_by 多个条件聚合函数 dplyr
- postman - Newmain 进程在处理 Docker 容器中作为 Jenkins 代理运行的大约 10K 请求后终止