In WPF, is it possible to apply a Converter to the SortDescription of a CollectionViewSource? My ViewModel contains a List<> of a class that contains an enum and a Boolean. My XAML displays a multi-select ListBox, showing the localized names of the enum values using a Converter in the View, and binds each ListBoxItem’s IsSelected to the Boolean in the members of the bound List<>. That’s working. Now I want to sort the ListBox items by those localized enum names, without reordering the List<> in the ViewModel. How can this be done?
I’m not sure it can be done directly. The brute force and ignorance way I would tackle it with is to populate another list and sort that (or indeed populate a sorted list).
No TweetBacks yet. (Be the first to Tweet this post)
August 31st, 2010 at 11:16 am
I’m not sure it can be done directly. The brute force and ignorance way I would tackle it with is to populate another list and sort that (or indeed populate a sorted list).
References :