DevicePlot.xaml 5.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. <UserControl x:Class="DeviceManagement.Controls.DevicePlot"
  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.Controls"
  7. xmlns:resource="clr-namespace:UICommon;assembly=UICommon"
  8. mc:Ignorable="d"
  9. x:Name="This"
  10. d:DesignHeight="450" d:DesignWidth="800">
  11. <UserControl.Resources>
  12. <ResourceDictionary>
  13. <ResourceDictionary.MergedDictionaries>
  14. <ResourceDictionary Source="/UICommon;component/Resources.xaml"/>
  15. </ResourceDictionary.MergedDictionaries>
  16. <local:DeviceImageConverter x:Key="ImageConverter"/>
  17. <local:ConnectToImageConverter x:Key="ConnectConvert"/>
  18. </ResourceDictionary>
  19. </UserControl.Resources>
  20. <Border BorderBrush="DarkGray" Background="#f2f2f2" CornerRadius="16" BorderThickness="1" Width="320">
  21. <Grid Margin="12,6">
  22. <Grid.ColumnDefinitions>
  23. <ColumnDefinition Width="120"/>
  24. <ColumnDefinition/>
  25. </Grid.ColumnDefinitions>
  26. <Grid.RowDefinitions>
  27. <RowDefinition Height="auto"/>
  28. <RowDefinition Height="8"/>
  29. <RowDefinition Height="auto"/>
  30. <RowDefinition Height="8"/>
  31. </Grid.RowDefinitions>
  32. <Grid Margin="0,8">
  33. <Grid.RowDefinitions>
  34. <RowDefinition Height="auto"/>
  35. <RowDefinition Height="4"/>
  36. <RowDefinition Height="auto"/>
  37. <RowDefinition Height="4"/>
  38. <RowDefinition Height="auto"/>
  39. <RowDefinition Height="4"/>
  40. <RowDefinition Height="auto"/>
  41. <RowDefinition Height="*"/>
  42. <RowDefinition Height="auto"/>
  43. </Grid.RowDefinitions>
  44. <StackPanel Orientation="Horizontal">
  45. <TextBlock Grid.Row="0" FontSize="18" VerticalAlignment="Center" Text="{Binding ElementName=This, Path=DeviceInfo.DeviceModel}"/>
  46. <Image Source="{Binding ElementName=This, Path=DeviceInfo.IsConnected, Converter={StaticResource ConnectConvert}}" VerticalAlignment="Center" Margin="8,0" Height="18"/>
  47. </StackPanel>
  48. <TextBlock Grid.Row="2" VerticalAlignment="Center" Text="{Binding ElementName=This, Path=DeviceInfo.DeviceSubModel}"/>
  49. <TextBlock Grid.Row="4" VerticalAlignment="Center" Text="{Binding ElementName=This, Path=DeviceInfo.DeviceName}"/>
  50. <TextBlock Grid.Row="6" VerticalAlignment="Center" Text="{Binding ElementName=This, Path=DeviceInfo.Position}" TextWrapping="WrapWithOverflow"/>
  51. <StackPanel Grid.Row="8" Orientation="Horizontal">
  52. <Button Background="Transparent" BorderThickness="0"
  53. Command="{Binding ElementName=This, Path=SettingCommand}" CommandParameter="{Binding ElementName=This, Path=DeviceInfo}">
  54. <Image Source="{StaticResource Icon_Edit}" Height="24" />
  55. </Button>
  56. <Button Background="Transparent" BorderThickness="0" Margin="8,0"
  57. Command="{Binding ElementName=This, Path=DeleteCommand}" CommandParameter="{Binding ElementName=This, Path=DeviceInfo}">
  58. <Image Source="{StaticResource delete_fillDrawingImage}" Height="24" />
  59. </Button>
  60. </StackPanel>
  61. </Grid>
  62. <Image Grid.Column="1" Source="{Binding ElementName=This, Path=DeviceInfo.DeviceModel, Converter={StaticResource ImageConverter}}" Height="148" Stretch="Uniform"/>
  63. <Grid Grid.Row="2" Grid.ColumnSpan="3" >
  64. <Grid.ColumnDefinitions>
  65. <ColumnDefinition Width="*"/>
  66. <ColumnDefinition Width="16"/>
  67. <ColumnDefinition Width="*"/>
  68. </Grid.ColumnDefinitions>
  69. <Button Height="32" Background="Transparent" HorizontalContentAlignment="Center" BorderBrush="{StaticResource ThemeColor}"
  70. Command="{Binding ElementName=This, Path=DetailCommand}" CommandParameter="{Binding ElementName=This, Path=DeviceInfo}">
  71. <TextBlock Foreground="{StaticResource ThemeColor}" Margin="8,0">数据分析</TextBlock>
  72. </Button>
  73. <Button Grid.Column="2" Height="32" Background="Transparent" HorizontalContentAlignment="Center" BorderBrush="{StaticResource ThemeColor}"
  74. Command="{Binding ElementName=This, Path=RemoteControlCommand}" CommandParameter="{Binding ElementName=This, Path=DeviceInfo}">
  75. <TextBlock Foreground="{StaticResource ThemeColor}" Margin="8,0">远程操作</TextBlock>
  76. </Button>
  77. </Grid>
  78. <!--<TextBlock Grid.Row="2" Grid.ColumnSpan="2" >
  79. <Run>UID:</Run>
  80. <Run Text="{Binding ElementName=This, Path=DeviceInfo.Guid}"/>
  81. </TextBlock>-->
  82. </Grid>
  83. </Border>
  84. </UserControl>