终端一体化运控平台
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

196 line
9.4 KiB

  1. <UserControl
  2. x:Class="BPASmartClient.FoodStationTest.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.FoodStationTest.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.FoodStationTest.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 Margin="-5,0,5,0">
  45. <Grid>
  46. <ListView
  47. Grid.Column="1"
  48. Margin="10"
  49. Background="Transparent"
  50. BorderBrush="#00BEFA"
  51. BorderThickness="0"
  52. ItemsSource="{Binding devices}"
  53. ScrollViewer.HorizontalScrollBarVisibility="Disabled">
  54. <ListView.ItemsPanel>
  55. <ItemsPanelTemplate>
  56. <!--<UniformGrid
  57. HorizontalAlignment="Left"
  58. VerticalAlignment="Top"
  59. Columns="8" />-->
  60. <WrapPanel Orientation="Horizontal" />
  61. </ItemsPanelTemplate>
  62. </ListView.ItemsPanel>
  63. <ListView.ItemTemplate>
  64. <DataTemplate>
  65. <Border
  66. Name="ShadowElement"
  67. Width="180"
  68. Height="150"
  69. Margin="10"
  70. VerticalAlignment="Top"
  71. BorderBrush="#00BEFA"
  72. BorderThickness="0"
  73. ClipToBounds="True"
  74. CornerRadius="0">
  75. <Border.Background>
  76. <ImageBrush ImageSource="/BPASmartClient.CustomResource;component/Image/蓝色背景.png" />
  77. </Border.Background>
  78. <Grid Margin="20,0,20,0">
  79. <!--<Grid.RowDefinitions>
  80. <RowDefinition />
  81. <RowDefinition />
  82. </Grid.RowDefinitions>
  83. <Grid.ColumnDefinitions>
  84. <ColumnDefinition />
  85. <ColumnDefinition />
  86. </Grid.ColumnDefinitions>-->
  87. <Grid.RowDefinitions>
  88. <RowDefinition />
  89. <RowDefinition />
  90. <RowDefinition />
  91. <RowDefinition />
  92. </Grid.RowDefinitions>
  93. <TextBlock
  94. Grid.Row="0"
  95. Grid.ColumnSpan="2"
  96. Margin="0,10,0,0"
  97. VerticalAlignment="Center"
  98. FontSize="20"
  99. Foreground="#00BEFA"
  100. Text="{Binding DeviceName}" />
  101. <StackPanel
  102. Grid.Row="1"
  103. VerticalAlignment="Center"
  104. Orientation="Horizontal">
  105. <TextBlock
  106. Grid.Row="1"
  107. FontSize="14"
  108. Foreground="#aa00BEFA"
  109. Text="设备IP:" />
  110. <TextBlock
  111. Grid.Row="1"
  112. FontSize="14"
  113. Foreground="#aa00BEFA"
  114. Text="{Binding IpAddress}" />
  115. </StackPanel>
  116. <Button
  117. Grid.Row="2"
  118. Width="130"
  119. Height="30"
  120. Margin="0,0,0,0"
  121. VerticalAlignment="Top"
  122. Command="{Binding DataContext.ChangeNameCommand, RelativeSource={RelativeSource AncestorType=ListView, Mode=FindAncestor}}"
  123. CommandParameter="{Binding IpAddress}"
  124. Content="修改原料名称"
  125. FontSize="16"
  126. IsEnabled="{Binding IsEnable}"
  127. Style="{StaticResource ImageButtonStyle}" />
  128. <WrapPanel Grid.Row="3">
  129. <Button
  130. Width="65"
  131. Height="30"
  132. Margin="0,0,0,0"
  133. VerticalAlignment="Top"
  134. Command="{Binding DataContext.Open, RelativeSource={RelativeSource AncestorType=ListView, Mode=FindAncestor}}"
  135. CommandParameter="{Binding IpAddress}"
  136. Content="开盖"
  137. FontSize="16"
  138. IsEnabled="{Binding IsEnable}"
  139. Style="{StaticResource ImageButtonStyle}" />
  140. <Button
  141. Width="65"
  142. Height="30"
  143. Margin="10,0,0,0"
  144. VerticalAlignment="Top"
  145. Command="{Binding DataContext.Close, RelativeSource={RelativeSource AncestorType=ListView, Mode=FindAncestor}}"
  146. CommandParameter="{Binding IpAddress}"
  147. Content="关盖"
  148. FontSize="16"
  149. IsEnabled="{Binding IsEnable}"
  150. Style="{StaticResource ImageButtonStyle}" />
  151. </WrapPanel>
  152. <!--<Button
  153. Grid.Row="1"
  154. Grid.Column="0"
  155. Grid.ColumnSpan="2"
  156. Foreground="#00BEFA"
  157. Width="130"
  158. Height="30"
  159. Margin="0,0,0,10"
  160. HorizontalAlignment="Left"
  161. VerticalAlignment="Bottom"
  162. Command="{Binding DataContext.ChangeNameCommand, RelativeSource={RelativeSource AncestorType=ListView, Mode=FindAncestor}}"
  163. CommandParameter="{Binding IpAddress}"
  164. Content="修改原料名称"
  165. IsEnabled="{Binding IsEnable}">
  166. <Button.Background>
  167. <ImageBrush ImageSource="/BPASmartClient.CustomResource;component/Image/系统名称.png" />
  168. </Button.Background>
  169. </Button>-->
  170. </Grid>
  171. </Border>
  172. </DataTemplate>
  173. </ListView.ItemTemplate>
  174. </ListView>
  175. </Grid>
  176. </Grid>
  177. </UserControl>