Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <GroupStyle>
- <GroupStyle.HeaderTemplate>
- <DataTemplate>
- <TextBlock Text='{Binding Key}' Foreground="{StaticResource ApplicationForegroundThemeBrush}" Margin="5" FontSize="18" FontFamily="Segoe UI" FontWeight="Light" />
- DataTemplate>
- </GroupStyle.HeaderTemplate>
- </GroupStyle>
- public List<ItemList> CreateGroupedData()
- {
- if (ReceivedList!= null)
- {
- var result =
- from t in ReceivedList
- group t by t.GroupField into g
- orderby g.Key
- select new { Key = g.Key, Items = g };
- List<ItemList> lists = new List<ItemList>();
- foreach (var i in result)
- {
- ItemList list = new ItemList();
- list.Key = $"{i.Key.ToString)} [{i.Items.Count.ToString()}]";
- lists.Add(list);
- }
- return lists;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement