private void Sort() { EventsGrouped.Clear(); var sorted = from e in Events orderby e.Time descending group e by e.Year into eGroup select new Grouping <string, Event>(eGroup.Key, eGroup); foreach (var sort in sorted) { EventsGrouped.Add(sort); } }
void SortEvents() { EventsGrouped.ReplaceRange(Events.GroupByDate()); }