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

191 řádky
9.1 KiB

  1. <UserControl
  2. x:Class="BPASmartClient.JXJFoodSmallStation.View.ManualCommView"
  3. xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  4. xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  5. xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
  6. xmlns:local="clr-namespace:BPASmartClient.JXJFoodSmallStation.View"
  7. xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
  8. xmlns:pry="clr-namespace:BPASmartClient.CustomResource.UserControls;assembly=BPASmartClient.CustomResource"
  9. xmlns:vm="clr-namespace:BPASmartClient.JXJFoodSmallStation.ViewModel"
  10. d:DesignHeight="850"
  11. d:DesignWidth="1200"
  12. mc:Ignorable="d">
  13. <UserControl.DataContext>
  14. <vm:ManualCommViewModel />
  15. </UserControl.DataContext>
  16. <UserControl.Resources>
  17. <Style x:Key="radioButtonStyle" TargetType="RadioButton">
  18. <Setter Property="Template">
  19. <Setter.Value>
  20. <ControlTemplate TargetType="RadioButton">
  21. <Grid Name="gr" Opacity="0.8">
  22. <ContentControl
  23. Margin="{TemplateBinding Margin}"
  24. HorizontalAlignment="Center"
  25. VerticalAlignment="Center"
  26. HorizontalContentAlignment="Center"
  27. VerticalContentAlignment="Center"
  28. Content="{TemplateBinding Content}"
  29. FontSize="{TemplateBinding FontSize}"
  30. Foreground="{TemplateBinding Foreground}" />
  31. <Image
  32. Name="image"
  33. Source="/BPASmartClient.CustomResource;component/Image/边框线.png"
  34. Stretch="Fill" />
  35. </Grid>
  36. <ControlTemplate.Triggers>
  37. <Trigger Property="IsChecked" Value="False">
  38. <Setter TargetName="image" Property="Source" Value="/BPASmartClient.CustomResource;component/Image/边框线.png" />
  39. </Trigger>
  40. <Trigger Property="IsChecked" Value="True">
  41. <Setter TargetName="image" Property="Source" Value="/BPASmartClient.CustomResource;component/Image/透明背景.png" />
  42. </Trigger>
  43. <Trigger Property="IsMouseOver" Value="True">
  44. <Setter TargetName="gr" Property="Opacity" Value="1" />
  45. </Trigger>
  46. </ControlTemplate.Triggers>
  47. </ControlTemplate>
  48. </Setter.Value>
  49. </Setter>
  50. </Style>
  51. </UserControl.Resources>
  52. <Grid Margin="10">
  53. <Grid.RowDefinitions>
  54. <RowDefinition Height="40" />
  55. <RowDefinition />
  56. </Grid.RowDefinitions>
  57. <!--#region 表格标题栏设置-->
  58. <Grid
  59. Grid.Row="0"
  60. Margin="0,10,0,0"
  61. Background="#ff0C255F">
  62. <Grid.ColumnDefinitions>
  63. <ColumnDefinition Width="1*" />
  64. <ColumnDefinition Width="3*" />
  65. <ColumnDefinition Width="4*" />
  66. <ColumnDefinition Width="2*" />
  67. <ColumnDefinition Width="2*" />
  68. <ColumnDefinition Width="2*" />
  69. </Grid.ColumnDefinitions>
  70. <Grid Grid.Column="0">
  71. <TextBlock
  72. HorizontalAlignment="Center"
  73. VerticalAlignment="Center"
  74. Foreground="Aqua"
  75. Text="序号" />
  76. <Border BorderThickness="1,0,1,0" Cursor="SizeWE" />
  77. </Grid>
  78. <TextBlock
  79. Grid.Column="1"
  80. HorizontalAlignment="Center"
  81. VerticalAlignment="Center"
  82. Foreground="Aqua"
  83. Text="地址" />
  84. <Grid Grid.Column="2">
  85. <TextBlock
  86. HorizontalAlignment="Center"
  87. VerticalAlignment="Center"
  88. Foreground="Aqua"
  89. Text="描述" />
  90. <Border BorderThickness="1,0,1,0" Cursor="SizeWE" />
  91. </Grid>
  92. <TextBlock
  93. Grid.Column="3"
  94. HorizontalAlignment="Center"
  95. VerticalAlignment="Center"
  96. Foreground="Aqua"
  97. Text="当前值" />
  98. <Grid Grid.Column="4">
  99. <TextBlock
  100. HorizontalAlignment="Center"
  101. VerticalAlignment="Center"
  102. Foreground="Aqua"
  103. Text="设定值" />
  104. <Border BorderThickness="1,0,1,0" Cursor="SizeWE" />
  105. </Grid>
  106. <TextBlock
  107. Grid.Column="5"
  108. HorizontalAlignment="Center"
  109. VerticalAlignment="Center"
  110. Foreground="Aqua"
  111. Text="功能操作" />
  112. <Border Grid.ColumnSpan="10" BorderThickness="1,0,1,0" />
  113. </Grid>
  114. <Grid Grid.Row="1">
  115. <ScrollViewer HorizontalScrollBarVisibility="Hidden" VerticalScrollBarVisibility="Hidden">
  116. <ItemsControl Foreground="Aqua" ItemsSource="{Binding PlcInfo}">
  117. <ItemsControl.ItemTemplate>
  118. <DataTemplate>
  119. <Grid Name="gr">
  120. <Grid.ColumnDefinitions>
  121. <ColumnDefinition Width="1*" />
  122. <ColumnDefinition Width="3*" />
  123. <ColumnDefinition Width="4*" />
  124. <ColumnDefinition Width="2*" />
  125. <ColumnDefinition Width="2*" />
  126. <ColumnDefinition Width="2*" />
  127. </Grid.ColumnDefinitions>
  128. <Grid Grid.Column="0">
  129. <TextBlock
  130. HorizontalAlignment="Center"
  131. VerticalAlignment="Center"
  132. Text="{Binding SerialNum}" />
  133. <Border BorderThickness="1,0,1,0" Cursor="SizeWE" />
  134. </Grid>
  135. <TextBlock
  136. Grid.Column="1"
  137. HorizontalAlignment="Center"
  138. VerticalAlignment="Center"
  139. Text="{Binding Address}" />
  140. <Grid Grid.Column="2">
  141. <TextBlock
  142. HorizontalAlignment="Center"
  143. VerticalAlignment="Center"
  144. Text="{Binding Describe}" />
  145. <Border BorderThickness="1,0,1,0" Cursor="SizeWE" />
  146. </Grid>
  147. <TextBlock
  148. Grid.Column="3"
  149. HorizontalAlignment="Center"
  150. VerticalAlignment="Center"
  151. Text="{Binding NowValue}" />
  152. <Grid Grid.Column="4">
  153. <TextBox Text="{Binding SetValue}" />
  154. <Border BorderThickness="1,0,1,0" Cursor="SizeWE" />
  155. </Grid>
  156. <Grid Grid.Column="5">
  157. <pry:IcoButton
  158. Grid.Column="0"
  159. Margin="40,5,40,5"
  160. Command="{Binding DataContext.SetParCommand, RelativeSource={RelativeSource AncestorType=ItemsControl, Mode=FindAncestor}}"
  161. CommandParameter="{Binding Address}"
  162. Content="设置"
  163. FontSize="20"
  164. Foreground="Aqua"
  165. Style="{StaticResource IcoButtonStyle}" />
  166. <Border BorderThickness="1,0,1,0" Cursor="SizeWE" />
  167. </Grid>
  168. <Border Grid.ColumnSpan="10" BorderThickness="1,0,1,1" />
  169. </Grid>
  170. <DataTemplate.Triggers>
  171. <Trigger Property="IsMouseOver" Value="true">
  172. <Setter TargetName="gr" Property="Background" Value="#112AB2E7" />
  173. </Trigger>
  174. </DataTemplate.Triggers>
  175. </DataTemplate>
  176. </ItemsControl.ItemTemplate>
  177. </ItemsControl>
  178. </ScrollViewer>
  179. </Grid>
  180. </Grid>
  181. </UserControl>