I have an ObservableCollection<T>. I’ve bound it to a ListBox control and I’ve added SortDescriptions to the Items collection on the ListBox to make the list sort how I want.
I want to resort the list at ANY point when any property changed on a child element.
All my child elements implement INotifyPropertyChanged.
Brute force:
EDIT:
The code for 1, 2 would live in your code-behind.
For #1, you’d do something like:
For #2, in your CollectionChanged handler, you would do something like:
EDIT2:
However, in this case, I would strongly suggest that you also check ListCollectionView.NeedsRefresh and only refresh if that is set. There’s no reason to re-sort if your properties have changed which don’t affect the sort.