How can I make group headers selectable in a ListBox using custom GroupItem implementation?

I'm trying to figure out how I can modify the ListBox control so that group headers are also selectable.


My idea is that I could add an "IsSelected" property to the GroupItem (or maybe Expander?) class and then handle the logic in a custom version of the ListBox control.

I've tried looking at the ItemsControl, ListBox & GroupItem class on MSDN, but I've not been able to spot how the GroupItem is connected to the aforementioned controls.

Does anybody know how I could accomplish this?

I know StackOverflow is a Q&A site, but if anyone want's to suggest a better method, feel free!

NOTE: The suggestion should be MVVM compatible.

EDIT: I also thought of using a TreeView, but then I can't filter the items using a CollectionViewSource.