终端一体化运控平台
Ви не можете вибрати більше 25 тем Теми мають розпочинатися з літери або цифри, можуть містити дефіси (-) і не повинні перевищувати 35 символів.
 
 
 

150 рядки
6.5 KiB

  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 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="4" />
  60. </ItemsPanelTemplate>
  61. </ListView.ItemsPanel>
  62. <ListView.ItemTemplate>
  63. <DataTemplate>
  64. <Border
  65. Name="ShadowElement"
  66. Height="150"
  67. VerticalAlignment="Top"
  68. BorderBrush="#00BEFA"
  69. BorderThickness="2"
  70. ClipToBounds="True"
  71. CornerRadius="8">
  72. <Border.Effect>
  73. <DropShadowEffect
  74. BlurRadius="18"
  75. ShadowDepth="0"
  76. Color="#00BEFA" />
  77. </Border.Effect>
  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. <TextBlock
  88. Grid.Row="0"
  89. Grid.ColumnSpan="2"
  90. VerticalAlignment="Bottom"
  91. Margin="0 0 0 5"
  92. FontSize="20"
  93. Foreground="#00BEFA"
  94. Text="{Binding DeviceName}" />
  95. <StackPanel
  96. Grid.Row="1"
  97. Grid.ColumnSpan="2"
  98. Orientation="Horizontal">
  99. <TextBlock
  100. Grid.Row="1"
  101. FontSize="14"
  102. Foreground="Aqua"
  103. Text="设备IP:" />
  104. <TextBlock
  105. Grid.Row="1"
  106. FontSize="14"
  107. Foreground="Aqua"
  108. Text="{Binding IpAddress}" />
  109. </StackPanel>
  110. <Button
  111. Grid.Row="1"
  112. Grid.Column="0"
  113. Grid.ColumnSpan="2"
  114. Foreground="#00BEFA"
  115. Width="130"
  116. Height="30"
  117. Margin="0,0,0,10"
  118. HorizontalAlignment="Left"
  119. VerticalAlignment="Bottom"
  120. Command="{Binding DataContext.ChangeNameCommand, RelativeSource={RelativeSource AncestorType=ListView, Mode=FindAncestor}}"
  121. CommandParameter="{Binding IpAddress}"
  122. Content="修改原料名称"
  123. IsEnabled="{Binding IsEnable}">
  124. <Button.Background>
  125. <ImageBrush ImageSource="/BPASmartClient.CustomResource;component/Image/蓝边框.png" />
  126. </Button.Background>
  127. </Button>
  128. </Grid>
  129. </Border>
  130. </DataTemplate>
  131. </ListView.ItemTemplate>
  132. </ListView>
  133. </Grid>
  134. </Grid>
  135. </UserControl>