I am using a ListCollectionView as a datacontext to a tab control. I have added a GroupDescription to it based on an enum and I want a particular group to appear as the first tab in the tab control however now it is always being put on the bottom.
Profiles = new ListCollectionView(_profiles);
Profiles.GroupDescriptions.Add(new PropertyGroupDescription("ProfileType"));
Profiles.SortDescriptions.Add(new SortDescription("ProfileName", ListSortDirection.Ascending));
_profiles is an ObservableCollection of my profile ViewModels.
My Enum looks like:
public enum ProfileTypeEnum
{
CurrentSettings,
CustomSettings,
DefaultSettings
}
So how can I force the CurrentSettings group to always be first?
Try to use an auxiliary property:
give values to the enumeration:
and add a sort description:
this way you can use enumeration’s values to alter the order and force one on top.