DeviceManager.xaml 3.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  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. <Grid.RowDefinitions>
  17. <RowDefinition Height="auto"/>
  18. <RowDefinition Height="4"/>
  19. <RowDefinition/>
  20. </Grid.RowDefinitions>
  21. <Button Command="{Binding RefreshCommand}" Height="32" Width="84" Background="Transparent" BorderBrush="{StaticResource ThemeColor}" Foreground="{StaticResource ThemeColor}" HorizontalAlignment="Left">刷新设备列表</Button>
  22. <ScrollViewer Grid.Row="2">
  23. <ItemsControl ItemsSource="{Binding Devices}">
  24. <ItemsControl.ItemTemplate>
  25. <DataTemplate>
  26. <Expander Margin="8" IsExpanded="True">
  27. <Expander.Header>
  28. <TextBlock Text="{Binding Key}" FontSize="13"></TextBlock>
  29. </Expander.Header>
  30. <ItemsControl ItemsSource="{Binding Value}">
  31. <ItemsControl.ItemTemplate>
  32. <DataTemplate>
  33. <controls:DevicePlot DeviceInfo="{Binding}" Margin="8"
  34. DetailCommand="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=local:DeviceManager}, Path=DataContext.CheckDetailCommand}"
  35. RemoteControlCommand="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=local:DeviceManager}, Path=DataContext.RemoteCommand}"
  36. SettingCommand="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=local:DeviceManager}, Path=DataContext.SettingCommand}"
  37. DeleteCommand="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=local:DeviceManager}, Path=DataContext.DeleteCommand}"/>
  38. </DataTemplate>
  39. </ItemsControl.ItemTemplate>
  40. <ItemsControl.ItemsPanel>
  41. <ItemsPanelTemplate>
  42. <WrapPanel/>
  43. </ItemsPanelTemplate>
  44. </ItemsControl.ItemsPanel>
  45. </ItemsControl>
  46. </Expander>
  47. </DataTemplate>
  48. </ItemsControl.ItemTemplate>
  49. <ItemsControl.ItemsPanel>
  50. <ItemsPanelTemplate>
  51. <StackPanel/>
  52. </ItemsPanelTemplate>
  53. </ItemsControl.ItemsPanel>
  54. </ItemsControl>
  55. </ScrollViewer>
  56. </Grid>
  57. </UserControl>