终端一体化运控平台
選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。

DeviceListView.xaml 7.5 KiB

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