终端一体化运控平台
Nelze vybrat více než 25 témat Téma musí začínat písmenem nebo číslem, může obsahovat pomlčky („-“) a může být dlouhé až 35 znaků.
 
 
 

144 řádky
6.1 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>
  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. FontSize="40"
  92. Foreground="#00BEFA"
  93. Text="{Binding DeviceName}" />
  94. <StackPanel
  95. Grid.Row="1"
  96. Grid.ColumnSpan="2"
  97. Orientation="Horizontal">
  98. <TextBlock
  99. Grid.Row="1"
  100. FontSize="14"
  101. Foreground="Aqua"
  102. Text="设备IP:" />
  103. <TextBlock
  104. Grid.Row="1"
  105. FontSize="14"
  106. Foreground="Aqua"
  107. Text="{Binding IpAddress}" />
  108. </StackPanel>
  109. <Button
  110. Grid.Row="1"
  111. Grid.Column="0"
  112. Grid.ColumnSpan="2"
  113. Width="130"
  114. Height="30"
  115. Margin="0,0,0,10"
  116. HorizontalAlignment="Left"
  117. VerticalAlignment="Bottom"
  118. Command="{Binding DataContext.ChangeNameCommand, RelativeSource={RelativeSource AncestorType=ListView, Mode=FindAncestor}}"
  119. CommandParameter="{Binding IpAddress}"
  120. Content="修改设备名称"
  121. IsEnabled="{Binding IsEnable}" />
  122. </Grid>
  123. </Border>
  124. </DataTemplate>
  125. </ListView.ItemTemplate>
  126. </ListView>
  127. </Grid>
  128. </Grid>
  129. </UserControl>