I am allowing the users to sort items shown by an ItemsControl using something similar to
var listCollectionView = CollectionViewSource.GetDefaultView(myItemsControl.ItemsSource);
listCollectionView.CustomSort = mySortComparer;
// Alternative, same Problem:
// listCollectionView.SortDescriptions.Add(new SortDescription(myProperty));
The ItemTemplate for my collection is a little complicated and creating all the item representations requires a significant amount of time. I've found, using the profiler, that each sort re-creates every item in the ItemsControl, instead of using the old items and just moving them.
Is there a way to prevent this?