DeviceManager.xaml 3.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  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="/UICommon;component/Resources.xaml"/>
  14. </UserControl.Resources>
  15. <Grid>
  16. <ScrollViewer>
  17. <ItemsControl ItemsSource="{Binding 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}" Margin="8"
  28. DetailCommand="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=local:DeviceManager}, Path=DataContext.CheckDetailCommand}"
  29. RemoteControlCommand="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=local:DeviceManager}, Path=DataContext.RemoteCommand}"
  30. SettingCommand="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=local:DeviceManager}, Path=DataContext.SettingCommand}"
  31. DeleteCommand="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=local:DeviceManager}, Path=DataContext.DeleteCommand}"/>
  32. </DataTemplate>
  33. </ItemsControl.ItemTemplate>
  34. <ItemsControl.ItemsPanel>
  35. <ItemsPanelTemplate>
  36. <WrapPanel/>
  37. </ItemsPanelTemplate>
  38. </ItemsControl.ItemsPanel>
  39. </ItemsControl>
  40. </Expander>
  41. </DataTemplate>
  42. </ItemsControl.ItemTemplate>
  43. <ItemsControl.ItemsPanel>
  44. <ItemsPanelTemplate>
  45. <StackPanel/>
  46. </ItemsPanelTemplate>
  47. </ItemsControl.ItemsPanel>
  48. </ItemsControl>
  49. </ScrollViewer>
  50. </Grid>
  51. </UserControl>