终端一体化运控平台
Nie możesz wybrać więcej, niż 25 tematów Tematy muszą się zaczynać od litery lub cyfry, mogą zawierać myślniki ('-') i mogą mieć do 35 znaków.
 
 
 

175 wiersze
9.1 KiB

  1. <UserControl
  2. x:Class="BPASmartClient.FoodStationTest.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.FoodStationTest.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.FoodStationTest.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 Text="序号" HorizontalAlignment="Center" VerticalAlignment="Center" Foreground="Aqua"/>
  72. <Border BorderThickness="1,0,1,0" Cursor="SizeWE" />
  73. </Grid>
  74. <TextBlock Grid.Column="1" Text="地址" HorizontalAlignment="Center" VerticalAlignment="Center" Foreground="Aqua" />
  75. <Grid Grid.Column="2">
  76. <TextBlock Text="描述" HorizontalAlignment="Center" VerticalAlignment="Center" Foreground="Aqua" />
  77. <Border BorderThickness="1,0,1,0" Cursor="SizeWE" />
  78. </Grid>
  79. <TextBlock Grid.Column="3" Text="当前值" HorizontalAlignment="Center" VerticalAlignment="Center" Foreground="Aqua" />
  80. <Grid Grid.Column="4">
  81. <TextBlock Text="设定值" HorizontalAlignment="Center" VerticalAlignment="Center" Foreground="Aqua" />
  82. <Border BorderThickness="1,0,1,0" Cursor="SizeWE" />
  83. </Grid>
  84. <TextBlock Grid.Column="5" Text="功能操作" HorizontalAlignment="Center" VerticalAlignment="Center" Foreground="Aqua" />
  85. <Border Grid.ColumnSpan="10" BorderThickness="1,0,1,0" />
  86. </Grid>
  87. <Grid Grid.Row="1">
  88. <ScrollViewer HorizontalScrollBarVisibility="Hidden" VerticalScrollBarVisibility="Hidden" >
  89. <ItemsControl ItemsSource="{Binding PlcInfo}" Foreground="Aqua">
  90. <ItemsControl.ItemTemplate>
  91. <DataTemplate>
  92. <Grid Name="gr" >
  93. <Grid.ColumnDefinitions>
  94. <ColumnDefinition Width="1*"/>
  95. <ColumnDefinition Width="3*"/>
  96. <ColumnDefinition Width="4*"/>
  97. <ColumnDefinition Width="2*"/>
  98. <ColumnDefinition Width="2*"/>
  99. <ColumnDefinition Width="2*"/>
  100. </Grid.ColumnDefinitions>
  101. <Grid Grid.Column="0">
  102. <TextBlock
  103. HorizontalAlignment="Center"
  104. VerticalAlignment="Center"
  105. Text="{Binding SerialNum}" />
  106. <Border
  107. BorderThickness="1,0,1,0"
  108. Cursor="SizeWE" />
  109. </Grid>
  110. <TextBlock
  111. Grid.Column="1"
  112. HorizontalAlignment="Center"
  113. VerticalAlignment="Center"
  114. Text="{Binding Address }" />
  115. <Grid Grid.Column="2">
  116. <TextBlock
  117. HorizontalAlignment="Center"
  118. VerticalAlignment="Center"
  119. Text="{Binding Describe}" />
  120. <Border
  121. BorderThickness="1,0,1,0"
  122. Cursor="SizeWE" />
  123. </Grid>
  124. <TextBlock
  125. HorizontalAlignment="Center"
  126. VerticalAlignment="Center"
  127. Grid.Column="3"
  128. Text="{Binding NowValue}" />
  129. <Grid Grid.Column="4">
  130. <TextBox
  131. Text="{Binding SetValue}" />
  132. <Border
  133. BorderThickness="1,0,1,0"
  134. Cursor="SizeWE" />
  135. </Grid>
  136. <Grid Grid.Column="5">
  137. <pry:IcoButton
  138. Command="{Binding DataContext.SetParCommand, RelativeSource={RelativeSource AncestorType=ItemsControl, Mode=FindAncestor}}"
  139. CommandParameter="{Binding Address}"
  140. Grid.Column="0"
  141. Margin="40,5,40,5"
  142. Content="设置"
  143. FontSize="20"
  144. Foreground="Aqua"
  145. Style="{StaticResource IcoButtonStyle}" />
  146. <Border
  147. BorderThickness="1,0,1,0"
  148. Cursor="SizeWE" />
  149. </Grid>
  150. <Border
  151. Grid.ColumnSpan="10"
  152. BorderThickness="1,0,1,1" />
  153. </Grid>
  154. <DataTemplate.Triggers>
  155. <Trigger Property="IsMouseOver" Value="true">
  156. <Setter TargetName="gr" Property="Background" Value="#112AB2E7" />
  157. </Trigger>
  158. </DataTemplate.Triggers>
  159. </DataTemplate>
  160. </ItemsControl.ItemTemplate>
  161. </ItemsControl>
  162. </ScrollViewer>
  163. </Grid>
  164. </Grid>
  165. </UserControl>