Does ListCollectionView.CustomSort use a stable sort?

Viewed 152

I sort a list in xaml using a ListCollectionView and a Comparer, and in another location in C# I need to sort in the exact same way, using the same Comparer, so the sort needs to be stable.

This sort is unstable:

myCollectionCopy = myCollection.ToList();
myCollectionCopy.Sort(myComparer);

This sort is stable:

myCollection.OrderBy(x => x.MyProperty, myComparer)

But what I can't figure out from the documentation is if ListCollectionView uses a stable sort when setting

myListCollectionView.CustomSort = myComparer;

See also: https://social.msdn.microsoft.com/Forums/vstudio/en-US/f5ea4976-1c3d-4e10-90e7-c7a0491fc28a/stable-sort-using-listt?forum=netfxbcl

0 Answers
Related