In a UWP app, I can set a CollectionViewSource's Source to a List and it will group it right off the bat. With WPF it seems to work differently. I want to be able to group my list in code behind and just feed it the collection instead of listview doing it for me with the PropertyGroupDescription.
public class MyGroup : ObservableCollection<MyClass>
{
public int ID{ get; set; }
public MyGroup (IEnumerable<MyClass> items) : base(items)
{
ID= items.First().ID;
}
}
//other code
collectionViewSource.Source = myGroup;
Then I just bind the collectionViewSource to the ItemSource. How can I do something like this in WPF?