The previous blog on Categorized Lists with LongListSelector demonstrated IGrouping implementation. If we play it right, we shouldn't have to touch the "Grouping" class to group using complex objects.

I'll use a playing card deck as a familiar data model that has categories to group on, i.e. the "Suit" that contains "Clubs", "Spades",  "Hearts" and "Diamonds" and where each card has a value from two through nine and including "Jack", "Queen", "King" and "Ace". The cards can appear in the LongListSelector with the Suit in the heading for each group and the value for each card making up the details ...

You can use LongListSelector as a glorified ListBox, but that cripples its true purpose. The real power  of LongListSelector is to display long categorized lists, enable a "People Hub" style "jump list" to navigate between groups in the list and to allow performant scrolling.

Grouping

The trick to get LongListSelector working is to properly group the data assigned to the LongListSelector ItemsSource. You can start with a simple flat list of objects, where each object has a property suitable for grouping. In the snippet below, "MyObject" has a "Category" property that the list will be grouped on....