终端一体化运控平台
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.

DeviceListView.xaml 7.6 KiB

2 years ago
2 years ago
2 years ago
2 years ago
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167
  1. <UserControl
  2. x:Class="BPASmartClient.JXJFoodSmallStation.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.JXJFoodSmallStation.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.JXJFoodSmallStation.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. </ItemsPanelTemplate>
  61. </ListView.ItemsPanel>
  62. <ListView.ItemTemplate>
  63. <DataTemplate>
  64. <Border
  65. Name="ShadowElement"
  66. Width="200"
  67. Height="150"
  68. Margin="10"
  69. VerticalAlignment="Top"
  70. BorderBrush="#00BEFA"
  71. BorderThickness="0"
  72. ClipToBounds="True"
  73. CornerRadius="0">
  74. <Border.Background>
  75. <ImageBrush ImageSource="/BPASmartClient.CustomResource;component/Image/蓝色背景.png" />
  76. </Border.Background>
  77. <Grid Margin="20,0,20,0">
  78. <!--<Grid.RowDefinitions>
  79. <RowDefinition />
  80. <RowDefinition />
  81. </Grid.RowDefinitions>
  82. <Grid.ColumnDefinitions>
  83. <ColumnDefinition />
  84. <ColumnDefinition />
  85. </Grid.ColumnDefinitions>-->
  86. <Grid.RowDefinitions>
  87. <RowDefinition />
  88. <RowDefinition />
  89. <RowDefinition />
  90. </Grid.RowDefinitions>
  91. <TextBlock
  92. Grid.Row="0"
  93. Grid.ColumnSpan="2"
  94. Margin="0,10,0,0"
  95. VerticalAlignment="Center"
  96. FontSize="20"
  97. Foreground="#00BEFA"
  98. Text="{Binding DeviceName}" />
  99. <StackPanel
  100. Grid.Row="1"
  101. VerticalAlignment="Center"
  102. Orientation="Horizontal">
  103. <TextBlock
  104. Grid.Row="1"
  105. FontSize="14"
  106. Foreground="#aa00BEFA"
  107. Text="设备IP:" />
  108. <TextBlock
  109. Grid.Row="1"
  110. FontSize="14"
  111. Foreground="#aa00BEFA"
  112. Text="{Binding IpAddress}" />
  113. </StackPanel>
  114. <Button
  115. Grid.Row="2"
  116. Width="130"
  117. Height="30"
  118. Margin="0,0,0,0"
  119. VerticalAlignment="Top"
  120. Command="{Binding DataContext.ChangeNameCommand, RelativeSource={RelativeSource AncestorType=ListView, Mode=FindAncestor}}"
  121. CommandParameter="{Binding IpAddress}"
  122. Content="修改原料名称"
  123. FontSize="16"
  124. IsEnabled="{Binding IsEnable}"
  125. Style="{StaticResource ImageButtonStyle}" />
  126. <!--<Button
  127. Grid.Row="1"
  128. Grid.Column="0"
  129. Grid.ColumnSpan="2"
  130. Foreground="#00BEFA"
  131. Width="130"
  132. Height="30"
  133. Margin="0,0,0,10"
  134. HorizontalAlignment="Left"
  135. VerticalAlignment="Bottom"
  136. Command="{Binding DataContext.ChangeNameCommand, RelativeSource={RelativeSource AncestorType=ListView, Mode=FindAncestor}}"
  137. CommandParameter="{Binding IpAddress}"
  138. Content="修改原料名称"
  139. IsEnabled="{Binding IsEnable}">
  140. <Button.Background>
  141. <ImageBrush ImageSource="/BPASmartClient.CustomResource;component/Image/系统名称.png" />
  142. </Button.Background>
  143. </Button>-->
  144. </Grid>
  145. </Border>
  146. </DataTemplate>
  147. </ListView.ItemTemplate>
  148. </ListView>
  149. </Grid>
  150. </Grid>
  151. </UserControl>