DeviceManager.xaml 2.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. <UserControl x:Class="DeviceManagement.Views.DeviceManager"
  2. xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  3. xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  4. xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
  5. xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
  6. xmlns:local="clr-namespace:DeviceManagement.Views"
  7. xmlns:controls="clr-namespace:DeviceManagement.Controls"
  8. xmlns:prism="http://prismlibrary.com/"
  9. prism:ViewModelLocator.AutoWireViewModel="True"
  10. mc:Ignorable="d"
  11. d:DesignHeight="450" d:DesignWidth="800">
  12. <UserControl.Resources>
  13. <ResourceDictionary Source="/DeviceManagement;component/Resources.xaml"/>
  14. </UserControl.Resources>
  15. <Grid>
  16. <ScrollViewer>
  17. <ItemsControl ItemsSource="{Binding DeviceCollection.Devices}">
  18. <ItemsControl.ItemTemplate>
  19. <DataTemplate>
  20. <Expander Margin="8" IsExpanded="True">
  21. <Expander.Header>
  22. <TextBlock Text="{Binding Key}" FontSize="13"></TextBlock>
  23. </Expander.Header>
  24. <ItemsControl ItemsSource="{Binding Value}">
  25. <ItemsControl.ItemTemplate>
  26. <DataTemplate>
  27. <controls:DevicePlot DeviceInfo="{Binding}"
  28. DetailCommand="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=local:DeviceManager}, Path=DataContext.CheckDetailCommand}"
  29. SettingCommand="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=local:DeviceManager}, Path=DataContext.SettingCommand}"/>
  30. </DataTemplate>
  31. </ItemsControl.ItemTemplate>
  32. <ItemsControl.ItemsPanel>
  33. <ItemsPanelTemplate>
  34. <WrapPanel/>
  35. </ItemsPanelTemplate>
  36. </ItemsControl.ItemsPanel>
  37. </ItemsControl>
  38. </Expander>
  39. </DataTemplate>
  40. </ItemsControl.ItemTemplate>
  41. <ItemsControl.ItemsPanel>
  42. <ItemsPanelTemplate>
  43. <StackPanel/>
  44. </ItemsPanelTemplate>
  45. </ItemsControl.ItemsPanel>
  46. </ItemsControl>
  47. </ScrollViewer>
  48. </Grid>
  49. </UserControl>