终端一体化运控平台
Não pode escolher mais do que 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.

DeviceListView.xaml 7.7 KiB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168
  1. <UserControl
  2. x:Class="BPASmartClient.DosingHKProject.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.DosingHKProject.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.DosingHKProject.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. </Grid.RowDefinitions>
  92. <TextBlock
  93. Grid.Row="0"
  94. Grid.ColumnSpan="2"
  95. Margin="0,10,0,0"
  96. VerticalAlignment="Center"
  97. FontSize="20"
  98. Foreground="#00BEFA"
  99. Text="{Binding DeviceName}" />
  100. <StackPanel
  101. Grid.Row="1"
  102. VerticalAlignment="Center"
  103. Orientation="Horizontal">
  104. <TextBlock
  105. Grid.Row="1"
  106. FontSize="14"
  107. Foreground="#aa00BEFA"
  108. Text="设备IP:" />
  109. <TextBlock
  110. Grid.Row="1"
  111. FontSize="14"
  112. Foreground="#aa00BEFA"
  113. Text="{Binding IpAddress}" />
  114. </StackPanel>
  115. <Button
  116. Grid.Row="2"
  117. Width="130"
  118. Height="30"
  119. Margin="0,0,0,0"
  120. VerticalAlignment="Top"
  121. Command="{Binding DataContext.ChangeNameCommand, RelativeSource={RelativeSource AncestorType=ListView, Mode=FindAncestor}}"
  122. CommandParameter="{Binding IpAddress}"
  123. Content="修改原料名称"
  124. FontSize="16"
  125. IsEnabled="{Binding IsEnable}"
  126. Style="{StaticResource ImageButtonStyle}" />
  127. <!--<Button
  128. Grid.Row="1"
  129. Grid.Column="0"
  130. Grid.ColumnSpan="2"
  131. Foreground="#00BEFA"
  132. Width="130"
  133. Height="30"
  134. Margin="0,0,0,10"
  135. HorizontalAlignment="Left"
  136. VerticalAlignment="Bottom"
  137. Command="{Binding DataContext.ChangeNameCommand, RelativeSource={RelativeSource AncestorType=ListView, Mode=FindAncestor}}"
  138. CommandParameter="{Binding IpAddress}"
  139. Content="修改原料名称"
  140. IsEnabled="{Binding IsEnable}">
  141. <Button.Background>
  142. <ImageBrush ImageSource="/BPASmartClient.CustomResource;component/Image/系统名称.png" />
  143. </Button.Background>
  144. </Button>-->
  145. </Grid>
  146. </Border>
  147. </DataTemplate>
  148. </ListView.ItemTemplate>
  149. </ListView>
  150. </Grid>
  151. </Grid>
  152. </UserControl>