Advertisement
Guest User

Untitled

a guest
Oct 1st, 2014
141
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.78 KB | None | 0 0
  1. DataModel:
  2. class Reseller
  3. {
  4. public Dictionary<int, Car> Cars;
  5. ...
  6. }
  7.  
  8. class Car
  9. {
  10. public string Model { get; set; }
  11. public string Year { get; set; }
  12. ...
  13. }
  14.  
  15.  
  16. <!--Template1 contains a Dictionary<string, Reseller>-->
  17. <!-- Reseller has another dictionary of Cars like Dictionary<int, Car>-->
  18. <DataTemplate x:Key="Template1">
  19. <StackPanel Orientation="Horizontal">
  20. <GroupBox Header="{Binding Key}">
  21. <ListView x:Name="Internal_Template2
  22. ItemTemplate="{StaticResource Template2}"/>
  23. </GroupBox>
  24. </StackPanel>
  25. </DataTemplate>
  26.  
  27.  
  28. <DataTemplate x:Key="Template2">
  29. <Grid>
  30. <TextBlock Text="{Binding Template1.Value.Cars.Model}"/>
  31. <TextBlock Text="{Binding Template1.Value.Cars.Year}"/>
  32. </Grid>
  33. </DataTemplate>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement