终端一体化运控平台
No puede seleccionar más de 25 temas Los temas deben comenzar con una letra o número, pueden incluir guiones ('-') y pueden tener hasta 35 caracteres de largo.

DeviceListView.xaml 6.3 KiB

hace 2 años
hace 2 años
hace 2 años
hace 2 años
hace 2 años
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151
  1. <UserControl
  2. x:Class="BPASmartClient.DosingSystem.View.DeviceListView"
  3. xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  4. xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  5. xmlns:control="clr-namespace:BPASmartClient.CustomResource.UserControls;assembly=BPASmartClient.CustomResource"
  6. xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
  7. xmlns:local="clr-namespace:BPASmartClient.DosingSystem.View"
  8. xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
  9. xmlns:pry="clr-namespace:BPASmartClient.CustomResource.UserControls;assembly=BPASmartClient.CustomResource"
  10. xmlns:vm="clr-namespace:BPASmartClient.DosingSystem.ViewModel"
  11. d:DesignHeight="450"
  12. d:DesignWidth="800"
  13. mc:Ignorable="d">
  14. <UserControl.DataContext>
  15. <vm:DeviceListViewModel />
  16. </UserControl.DataContext>
  17. <UserControl.Resources>
  18. <Style x:Key="UserItemContainerStyle" TargetType="ListBoxItem">
  19. <Style.Resources>
  20. <!-- SelectedItem with focus -->
  21. <SolidColorBrush
  22. x:Key="{x:Static SystemColors.HighlightBrushKey}"
  23. Opacity=".4"
  24. Color="White" />
  25. <!-- SelectedItem without focus -->
  26. <SolidColorBrush
  27. x:Key="{x:Static SystemColors.ControlBrushKey}"
  28. Opacity=".4"
  29. Color="White" />
  30. </Style.Resources>
  31. <!-- 设置触发器 -->
  32. <Style.Triggers>
  33. <Trigger Property="IsMouseOver" Value="true">
  34. <Setter Property="Background" Value="White" />
  35. <Setter Property="Foreground" Value="White" />
  36. </Trigger>
  37. <Trigger Property="IsFocused" Value="true">
  38. <Setter Property="Background" Value="White" />
  39. <Setter Property="Foreground" Value="White" />
  40. </Trigger>
  41. </Style.Triggers>
  42. </Style>
  43. </UserControl.Resources>
  44. <Grid>
  45. <!--<pry:Bottle
  46. Width="80"
  47. Height="500"
  48. CurrentValue="50" />-->
  49. <!--<pry:MotorBottle IsRun="True" CurrentValue="100"/>-->
  50. <Grid>
  51. <ListView
  52. Grid.Column="1"
  53. Margin="10"
  54. Background="Transparent"
  55. BorderBrush="#00BEFA"
  56. BorderThickness="0"
  57. ItemsSource="{Binding devices}"
  58. ScrollViewer.HorizontalScrollBarVisibility="Disabled">
  59. <ListView.ItemsPanel>
  60. <ItemsPanelTemplate>
  61. <UniformGrid
  62. HorizontalAlignment="Left"
  63. VerticalAlignment="Top"
  64. Columns="4" />
  65. </ItemsPanelTemplate>
  66. </ListView.ItemsPanel>
  67. <ListView.ItemTemplate>
  68. <DataTemplate>
  69. <Border
  70. Name="ShadowElement"
  71. Height="150"
  72. VerticalAlignment="Top"
  73. BorderBrush="#00BEFA"
  74. BorderThickness="2"
  75. ClipToBounds="True"
  76. CornerRadius="8">
  77. <Border.Effect>
  78. <DropShadowEffect
  79. BlurRadius="18"
  80. ShadowDepth="0"
  81. Color="#00BEFA" />
  82. </Border.Effect>
  83. <Grid Margin="20,0,20,0">
  84. <Grid.RowDefinitions>
  85. <RowDefinition />
  86. <RowDefinition />
  87. </Grid.RowDefinitions>
  88. <Grid.ColumnDefinitions>
  89. <ColumnDefinition />
  90. <ColumnDefinition />
  91. </Grid.ColumnDefinitions>
  92. <TextBlock
  93. Grid.Row="0"
  94. Grid.ColumnSpan="2"
  95. VerticalAlignment="Bottom"
  96. FontSize="40"
  97. Foreground="#00BEFA"
  98. Text="{Binding DeviceName}" />
  99. <StackPanel
  100. Grid.Row="1"
  101. Grid.ColumnSpan="2"
  102. Orientation="Horizontal">
  103. <TextBlock
  104. Grid.Row="1"
  105. FontSize="14"
  106. Foreground="Aqua"
  107. Text="设备IP:" />
  108. <TextBlock
  109. Grid.Row="1"
  110. FontSize="14"
  111. Foreground="Aqua"
  112. Text="{Binding IpAddress}" />
  113. </StackPanel>
  114. <Button
  115. Grid.Row="1"
  116. Grid.Column="0"
  117. Grid.ColumnSpan="2"
  118. Width="130"
  119. Height="30"
  120. Margin="0,0,0,10"
  121. HorizontalAlignment="Left"
  122. VerticalAlignment="Bottom"
  123. Command="{Binding DataContext.ChangeNameCommand, RelativeSource={RelativeSource AncestorType=ListView, Mode=FindAncestor}}"
  124. CommandParameter="{Binding IpAddress}"
  125. Content="修改设备名称"
  126. IsEnabled="{Binding IsEnable}" />
  127. </Grid>
  128. </Border>
  129. </DataTemplate>
  130. </ListView.ItemTemplate>
  131. </ListView>
  132. </Grid>
  133. </Grid>
  134. </UserControl>