Advertisement
Guest User

Untitled

a guest
Oct 26th, 2016
57
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.85 KB | None | 0 0
  1. public class Result
  2. {
  3. public string CategoryName { get; set; }
  4. public string Description { get; set; }
  5. }
  6.  
  7. <UserControl.Resources>
  8. <CollectionViewSource x:Key="resultsCollection"
  9. Source="{Binding Results}">
  10. <CollectionViewSource.GroupDescriptions>
  11. <PropertyGroupDescription PropertyName="CategoryName" />
  12. </CollectionViewSource.GroupDescriptions>
  13. </CollectionViewSource>
  14. </UserControl.Resources>
  15.  
  16. <TabControl ItemsSource="{Binding Source={StaticResource resultsCollection}}">
  17. <TabControl.GroupStyle>
  18. <GroupStyle>
  19. <GroupStyle.HeaderTemplate>
  20. <DataTemplate>
  21. <TextBlock Text="{Binding Name}" />
  22. </DataTemplate>
  23. </GroupStyle.HeaderTemplate>
  24. </GroupStyle>
  25. </TabControl.GroupStyle>
  26. </TabControl>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement