MainPage.xaml 40 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487
  1. <Page x:Class="CCDCountWpf.WpfPage.MainPage"
  2. xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  3. xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  4. xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
  5. xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
  6. xmlns:local="clr-namespace:CCDCountWpf.WpfPage"
  7. xmlns:BindNameSpace="clr-namespace:CCDCountWpf"
  8. mc:Ignorable="d"
  9. Stylus.IsPressAndHoldEnabled="False"
  10. Stylus.IsFlicksEnabled="False"
  11. Title="MainPage" Height="1000" Width="1560" Loaded="Page_Loaded">
  12. <Grid>
  13. <Grid.RowDefinitions>
  14. <RowDefinition Height="*"/>
  15. <RowDefinition Height="335"/>
  16. </Grid.RowDefinitions>
  17. <Grid Grid.Row="0">
  18. <Grid.ColumnDefinitions>
  19. <ColumnDefinition Width="*"/>
  20. <ColumnDefinition Width="650"/>
  21. </Grid.ColumnDefinitions>
  22. <Border Grid.Column="0" BorderThickness="1" Margin="2,2,2,2">
  23. <Image x:Name="ShowBox" Source="{Binding BitmapImage}"/>
  24. </Border>
  25. <Grid Grid.Column="1">
  26. <Grid.RowDefinitions>
  27. <RowDefinition Height="*"/>
  28. <RowDefinition Height="100"/>
  29. </Grid.RowDefinitions>
  30. <Border>
  31. <DataGrid Name="AlarmMessDataGrid" ItemsSource="{Binding AlarmMessShowList}" AutoGenerateColumns="False" Margin="5,12,5,0" Background="{x:Null}" FontSize="18">
  32. <DataGrid.Columns>
  33. <DataGridTextColumn Binding="{Binding ID}" Width="50">
  34. <DataGridTextColumn.Header>
  35. <TextBlock Text="{DynamicResource Number}"/>
  36. </DataGridTextColumn.Header>
  37. </DataGridTextColumn>
  38. <!--<DataGridTextColumn x:Name="DataGridMessageTypeColumn" Binding="{Binding AlarmChType}" Width="155">
  39. <DataGridTextColumn.Header>
  40. <TextBlock Text="{DynamicResource MessageType}"/>
  41. </DataGridTextColumn.Header>
  42. </DataGridTextColumn>-->
  43. <DataGridTextColumn x:Name="DataGridMessageColumn" Binding="{Binding AlarmChMess}" Width="1*">
  44. <DataGridTextColumn.ElementStyle>
  45. <Style>
  46. <Setter Property="TextBlock.TextWrapping" Value="Wrap"/>
  47. <Setter Property="TextBlock.MaxHeight" Value="60"/>
  48. <!-- 限制最大高度 -->
  49. </Style>
  50. </DataGridTextColumn.ElementStyle>
  51. <DataGridTextColumn.Header>
  52. <TextBlock Text="{DynamicResource Message}"/>
  53. </DataGridTextColumn.Header>
  54. </DataGridTextColumn>
  55. <DataGridTextColumn Binding="{Binding AlarmDateTime}" Width="200">
  56. <DataGridTextColumn.Header>
  57. <TextBlock Text="{DynamicResource DateTime}"/>
  58. </DataGridTextColumn.Header>
  59. </DataGridTextColumn>
  60. </DataGrid.Columns>
  61. </DataGrid>
  62. </Border>
  63. <Border Grid.Row="1" Style="{StaticResource CardBackGround}" CornerRadius="8" BorderThickness="1" Margin="5,5,5,0" Height="90" VerticalAlignment="Top">
  64. <StackPanel>
  65. <StackPanel Orientation="Horizontal" HorizontalAlignment="Center" VerticalAlignment="Center" Margin="0,10,0,0">
  66. <TextBlock Text="{DynamicResource CanningSpeed}" HorizontalAlignment="Left" Margin="10,0,0,0" VerticalAlignment="Top" FontWeight="Bold" FontSize="20" Foreground="White" Width="170" TextAlignment="Center"/>
  67. <TextBlock Text="{Binding BottingCountSpeed}" Margin="0,0,0,0" Width="70" FontWeight="Bold" FontSize="20" Background="{x:Null}" Foreground="White" TextAlignment="Center"/>
  68. <TextBlock Text="{DynamicResource UnitCanningSpeed}" HorizontalAlignment="Left" Margin="10,0,0,0" VerticalAlignment="Top" FontWeight="Bold" FontSize="20" Foreground="White" Width="110" TextAlignment="Center"/>
  69. </StackPanel>
  70. <StackPanel Orientation="Horizontal" HorizontalAlignment="Center" VerticalAlignment="Center" Margin="0,10,0,0">
  71. <TextBlock Text="{DynamicResource CountingSpeed}" HorizontalAlignment="Left" Margin="10,0,0,0" VerticalAlignment="Top" FontWeight="Bold" FontSize="20" Foreground="White" TextAlignment="Center" Width="170"/>
  72. <TextBlock x:Name="ShuLiSpeedTbx" Text="{Binding ShuLiSpeed}" HorizontalAlignment="Left" Margin="0,0,0,0" Width="70" FontWeight="Bold" FontSize="20" Background="{x:Null}" Foreground="White" TextAlignment="Center"/>
  73. <TextBlock Text="{DynamicResource UnitCountingSpeed}" FontWeight="Bold" FontSize="20" Margin="10,0,0,0" Foreground="White" TextAlignment="Center" Width="110"/>
  74. </StackPanel>
  75. </StackPanel>
  76. </Border>
  77. </Grid>
  78. </Grid>
  79. <Grid Grid.Row="1">
  80. <Grid.ColumnDefinitions>
  81. <ColumnDefinition Width="*"/>
  82. <ColumnDefinition Width="380"/>
  83. <ColumnDefinition Width="550"/>
  84. </Grid.ColumnDefinitions>
  85. <Border Style="{StaticResource CardBackGround}" CornerRadius="8" BorderThickness="1" Margin="15,10,5,5">
  86. <StackPanel Orientation="Vertical" HorizontalAlignment="Center" Margin="10,0,0,0" VerticalAlignment="Center">
  87. <StackPanel Orientation="Horizontal" Margin="0,5,0,0" HorizontalAlignment="Center">
  88. <TextBlock Text="{DynamicResource ASpeed}" FontSize="22" Margin="0,0,0,0" VerticalAlignment="Center" Foreground="White" Width="180" TextAlignment="Center"/>
  89. <Button x:Name="BottingMaterialCylinderVibrationTableHighSpeedValueUpUPBtn" Content="++" Width="60" Height="59" Click="BottingMaterialCylinderVibrationTableHighSpeedValueUpUpBtn_Click" Style="{StaticResource BtnColor}" FontSize="20" Cursor="Hand" Margin="0,0,15,0">
  90. <Button.Template>
  91. <ControlTemplate TargetType="Button">
  92. <Border CornerRadius="5" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}">
  93. <ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center"/>
  94. </Border>
  95. </ControlTemplate>
  96. </Button.Template>
  97. </Button>
  98. <Button x:Name="BottingMaterialCylinderVibrationTableHighSpeedValueUpBtn" Content="+" Width="60" Height="60" Click="BottingMaterialCylinderVibrationTableHighSpeedValueUpBtn_Click" Style="{StaticResource BtnColor}" FontSize="20" Cursor="Hand" Margin="0,0,5,0">
  99. <Button.Template>
  100. <ControlTemplate TargetType="Button">
  101. <Border CornerRadius="5"
  102. Background="{TemplateBinding Background}"
  103. BorderBrush="{TemplateBinding BorderBrush}"
  104. BorderThickness="{TemplateBinding BorderThickness}">
  105. <ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center"/>
  106. </Border>
  107. </ControlTemplate>
  108. </Button.Template>
  109. </Button>
  110. <TextBox Text="{Binding Source={x:Static BindNameSpace:PlcSettingMessageBus.PlcMessageShowBindage},Path = ShakeTable1H_FillingSpeed,Mode=TwoWay,UpdateSourceTrigger=LostFocus}" FontSize="18" Width="90" HorizontalContentAlignment="Center" VerticalContentAlignment="Center" Foreground="White" Background="{x:Null}" KeyDown="TextBox_KeyDown"/>
  111. <Button x:Name="BottingMaterialCylinderVibrationTableHighSpeedValueDownBtn" Content="-" Width="60" Click="BottingMaterialCylinderVibrationTableHighSpeedValueDownBtn_Click" Style="{StaticResource BtnColor}" FontSize="20" Cursor="Hand" Margin="5,0,15,0">
  112. <Button.Template>
  113. <ControlTemplate TargetType="Button">
  114. <Border CornerRadius="5"
  115. Background="{TemplateBinding Background}"
  116. BorderBrush="{TemplateBinding BorderBrush}"
  117. BorderThickness="{TemplateBinding BorderThickness}">
  118. <ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center"/>
  119. </Border>
  120. </ControlTemplate>
  121. </Button.Template>
  122. </Button>
  123. <Button x:Name="BottingMaterialCylinderVibrationTableHighSpeedValueDownDownBtn" Content="--" Width="60" Click="BottingMaterialCylinderVibrationTableHighSpeedValueDownDownBtn_Click" Style="{StaticResource BtnColor}" FontSize="20" Cursor="Hand">
  124. <Button.Template>
  125. <ControlTemplate TargetType="Button">
  126. <Border CornerRadius="5"
  127. Background="{TemplateBinding Background}"
  128. BorderBrush="{TemplateBinding BorderBrush}"
  129. BorderThickness="{TemplateBinding BorderThickness}">
  130. <ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center"/>
  131. </Border>
  132. </ControlTemplate>
  133. </Button.Template>
  134. </Button>
  135. </StackPanel>
  136. <StackPanel Orientation="Horizontal" Margin="0,20,0,0" HorizontalAlignment="Center">
  137. <TextBlock Text="{DynamicResource BSpeed}" FontSize="22" Margin="0,0,0,0" VerticalAlignment="Center" Foreground="White" Width="180" TextAlignment="Center"/>
  138. <Button x:Name="BottingFilterVibrationTableHighSpeedValueUpUpBtn" Content="++" Width="60" Height="60" Click="BottingFilterVibrationTableHighSpeedValueUpUpBtn_Click" Style="{StaticResource BtnColor}" FontSize="20" Cursor="Hand" Margin="0,0,15,0">
  139. <Button.Template>
  140. <ControlTemplate TargetType="Button">
  141. <Border CornerRadius="5"
  142. Background="{TemplateBinding Background}"
  143. BorderBrush="{TemplateBinding BorderBrush}"
  144. BorderThickness="{TemplateBinding BorderThickness}">
  145. <ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center"/>
  146. </Border>
  147. </ControlTemplate>
  148. </Button.Template>
  149. </Button>
  150. <Button x:Name="BottingFilterVibrationTableHighSpeedValueUpBtn" Content="+" Width="60" Height="60" Click="BottingFilterVibrationTableHighSpeedValueUpBtn_Click" Style="{StaticResource BtnColor}" FontSize="20" Cursor="Hand" Margin="0,0,5,0">
  151. <Button.Template>
  152. <ControlTemplate TargetType="Button">
  153. <Border CornerRadius="5"
  154. Background="{TemplateBinding Background}"
  155. BorderBrush="{TemplateBinding BorderBrush}"
  156. BorderThickness="{TemplateBinding BorderThickness}">
  157. <ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center"/>
  158. </Border>
  159. </ControlTemplate>
  160. </Button.Template>
  161. </Button>
  162. <TextBox Text="{Binding Source={x:Static BindNameSpace:PlcSettingMessageBus.PlcMessageShowBindage},Path = ShakeTable2H_FillingSpeed,Mode=TwoWay,UpdateSourceTrigger=LostFocus}" FontSize="18" Width="90" HorizontalContentAlignment="Center" VerticalContentAlignment="Center" Foreground="White" Background="{x:Null}" KeyDown="TextBox_KeyDown"/>
  163. <Button x:Name="BottingFilterVibrationTableHighSpeedValueDownBtn" Content="-" Width="60" Click="BottingFilterVibrationTableHighSpeedValueDownBtn_Click" Style="{StaticResource BtnColor}" FontSize="20" Cursor="Hand" Margin="5,0,15,0">
  164. <Button.Template>
  165. <ControlTemplate TargetType="Button">
  166. <Border CornerRadius="5"
  167. Background="{TemplateBinding Background}"
  168. BorderBrush="{TemplateBinding BorderBrush}"
  169. BorderThickness="{TemplateBinding BorderThickness}">
  170. <ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center"/>
  171. </Border>
  172. </ControlTemplate>
  173. </Button.Template>
  174. </Button>
  175. <Button x:Name="BottingFilterVibrationTableHighSpeedValueDownDownBtn" Content="--" Width="60" Click="BottingFilterVibrationTableHighSpeedValueDownDownBtn_Click" Style="{StaticResource BtnColor}" FontSize="20" Cursor="Hand">
  176. <Button.Template>
  177. <ControlTemplate TargetType="Button">
  178. <Border CornerRadius="5"
  179. Background="{TemplateBinding Background}"
  180. BorderBrush="{TemplateBinding BorderBrush}"
  181. BorderThickness="{TemplateBinding BorderThickness}">
  182. <ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center"/>
  183. </Border>
  184. </ControlTemplate>
  185. </Button.Template>
  186. </Button>
  187. </StackPanel>
  188. <StackPanel Orientation="Horizontal" Margin="0,20,0,0" HorizontalAlignment="Center">
  189. <TextBlock Text="{DynamicResource CSpeed}" FontSize="22" Margin="0,0,0,0" VerticalAlignment="Center" Foreground="White" Width="180" TextAlignment="Center"/>
  190. <Button x:Name="BottingCountVibrationTableHighSpeedValueUpUpBtn" Content="++" Width="60" Height="60" Click="BottingCountVibrationTableHighSpeedValueUpUpBtn_Click" Style="{StaticResource BtnColor}" FontSize="20" Cursor="Hand" Margin="0,0,15,0">
  191. <Button.Template>
  192. <ControlTemplate TargetType="Button">
  193. <Border CornerRadius="5"
  194. Background="{TemplateBinding Background}"
  195. BorderBrush="{TemplateBinding BorderBrush}"
  196. BorderThickness="{TemplateBinding BorderThickness}">
  197. <ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center"/>
  198. </Border>
  199. </ControlTemplate>
  200. </Button.Template>
  201. </Button>
  202. <Button x:Name="BottingCountVibrationTableHighSpeedValueUpBtn" Content="+" Width="60" Height="60" Click="BottingCountVibrationTableHighSpeedValueUpBtn_Click" Style="{StaticResource BtnColor}" FontSize="20" Cursor="Hand" Margin="0,0,5,0">
  203. <Button.Template>
  204. <ControlTemplate TargetType="Button">
  205. <Border CornerRadius="5"
  206. Background="{TemplateBinding Background}"
  207. BorderBrush="{TemplateBinding BorderBrush}"
  208. BorderThickness="{TemplateBinding BorderThickness}">
  209. <ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center"/>
  210. </Border>
  211. </ControlTemplate>
  212. </Button.Template>
  213. </Button>
  214. <TextBox Text="{Binding Source={x:Static BindNameSpace:PlcSettingMessageBus.PlcMessageShowBindage},Path = ShakeTable3H_FillingSpeed,Mode=TwoWay,UpdateSourceTrigger=LostFocus}" FontSize="18" Width="90" HorizontalContentAlignment="Center" VerticalContentAlignment="Center" Background="{x:Null}" Foreground="White" KeyDown="TextBox_KeyDown"/>
  215. <Button x:Name="BottingCountVibrationTableHighSpeedValueDownBtn" Content="-" Width="60" Click="BottingCountVibrationTableHighSpeedValueDownBtn_Click" Style="{StaticResource BtnColor}" FontSize="20" Cursor="Hand" Margin="5,0,15,0">
  216. <Button.Template>
  217. <ControlTemplate TargetType="Button">
  218. <Border CornerRadius="5"
  219. Background="{TemplateBinding Background}"
  220. BorderBrush="{TemplateBinding BorderBrush}"
  221. BorderThickness="{TemplateBinding BorderThickness}">
  222. <ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center"/>
  223. </Border>
  224. </ControlTemplate>
  225. </Button.Template>
  226. </Button>
  227. <Button x:Name="BottingCountVibrationTableHighSpeedValueDownDownBtn" Content="--" Width="60" Click="BottingCountVibrationTableHighSpeedValueDownDownBtn_Click" Style="{StaticResource BtnColor}" FontSize="20" Cursor="Hand">
  228. <Button.Template>
  229. <ControlTemplate TargetType="Button">
  230. <Border CornerRadius="5"
  231. Background="{TemplateBinding Background}"
  232. BorderBrush="{TemplateBinding BorderBrush}"
  233. BorderThickness="{TemplateBinding BorderThickness}">
  234. <ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center"/>
  235. </Border>
  236. </ControlTemplate>
  237. </Button.Template>
  238. </Button>
  239. </StackPanel>
  240. <StackPanel Orientation="Horizontal" Margin="0,20,0,0" HorizontalAlignment="Center">
  241. <TextBlock Text="{DynamicResource PreservedValue}" FontSize="22" Margin="0,0,0,0" VerticalAlignment="Center" Foreground="White" Width="180" TextAlignment="Center"/>
  242. <Button x:Name="BottValueSetUpUpBtn" Content="++" Width="60" Height="60" Click="BottValueSetUpUpBtn_Click" Style="{StaticResource BtnColor}" FontSize="20" Cursor="Hand" Margin="0,0,15,0">
  243. <Button.Template>
  244. <ControlTemplate TargetType="Button">
  245. <Border CornerRadius="5"
  246. Background="{TemplateBinding Background}"
  247. BorderBrush="{TemplateBinding BorderBrush}"
  248. BorderThickness="{TemplateBinding BorderThickness}">
  249. <ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center"/>
  250. </Border>
  251. </ControlTemplate>
  252. </Button.Template>
  253. </Button>
  254. <Button x:Name="BottValueSetUpBtn" Content="+" Width="60" Height="60" Click="BottValueSetUpBtn_Click" Style="{StaticResource BtnColor}" FontSize="20" Cursor="Hand" Margin="0,0,5,0">
  255. <Button.Template>
  256. <ControlTemplate TargetType="Button">
  257. <Border CornerRadius="5"
  258. Background="{TemplateBinding Background}"
  259. BorderBrush="{TemplateBinding BorderBrush}"
  260. BorderThickness="{TemplateBinding BorderThickness}">
  261. <ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center"/>
  262. </Border>
  263. </ControlTemplate>
  264. </Button.Template>
  265. </Button>
  266. <TextBox Text="{Binding Source={x:Static BindNameSpace:PlcSettingMessageBus.PlcMessageShowBindage},Path = BottValueSet,Mode=TwoWay,UpdateSourceTrigger=LostFocus}" FontSize="18" Width="90" HorizontalContentAlignment="Center" VerticalContentAlignment="Center" Background="{x:Null}" Foreground="White" KeyDown="TextBox_KeyDown"/>
  267. <Button x:Name="BottValueSetDownBtn" Content="-" Width="60" Click="BottValueSetDownBtn_Click" Style="{StaticResource BtnColor}" FontSize="20" Cursor="Hand" Margin="5,0,15,0">
  268. <Button.Template>
  269. <ControlTemplate TargetType="Button">
  270. <Border CornerRadius="5"
  271. Background="{TemplateBinding Background}"
  272. BorderBrush="{TemplateBinding BorderBrush}"
  273. BorderThickness="{TemplateBinding BorderThickness}">
  274. <ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center"/>
  275. </Border>
  276. </ControlTemplate>
  277. </Button.Template>
  278. </Button>
  279. <Button x:Name="BottValueSetDownDownBtn" Content="--" Width="60" Click="BottValueSetDownDownBtn_Click" Style="{StaticResource BtnColor}" FontSize="20" Cursor="Hand">
  280. <Button.Template>
  281. <ControlTemplate TargetType="Button">
  282. <Border CornerRadius="5"
  283. Background="{TemplateBinding Background}"
  284. BorderBrush="{TemplateBinding BorderBrush}"
  285. BorderThickness="{TemplateBinding BorderThickness}">
  286. <ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center"/>
  287. </Border>
  288. </ControlTemplate>
  289. </Button.Template>
  290. </Button>
  291. </StackPanel>
  292. </StackPanel>
  293. </Border>
  294. <Border Name="ShuLiData" Grid.Column="1"
  295. Style="{StaticResource CardBackGround}"
  296. CornerRadius="8"
  297. BorderThickness="1"
  298. Margin="5,10,5,5" HorizontalAlignment="Right" Width="370">
  299. <Grid>
  300. <StackPanel Orientation="Horizontal" Margin="0,20,0,0" VerticalAlignment="Top" HorizontalAlignment="Center">
  301. <StackPanel HorizontalAlignment="Left">
  302. <Label Content="{DynamicResource TotalCount}" HorizontalAlignment="Left" Margin="10,5,0,0" VerticalAlignment="Top" FontWeight="Bold" FontSize="20" Foreground="White"/>
  303. <!--<Label Content="{DynamicResource OKCount}" HorizontalAlignment="Left" Margin="10,5,0,0" VerticalAlignment="Top" FontWeight="Bold" FontSize="20" Foreground="White"/>
  304. <Label Content="{DynamicResource NGCount}" HorizontalAlignment="Left" Margin="10,5,0,0" VerticalAlignment="Top" FontWeight="Bold" FontSize="20" Foreground="White"/>-->
  305. <Label Content="{DynamicResource BottlingQuantity}" HorizontalAlignment="Left" Margin="10,5,0,0" VerticalAlignment="Top" FontWeight="Bold" FontSize="20" Foreground="White"/>
  306. </StackPanel>
  307. <StackPanel HorizontalAlignment="Left">
  308. <Label x:Name="AllActiveNumLab" Content="{Binding AllActiveNum}" HorizontalAlignment="Left" Margin="0,5,0,0" Width="100" FontWeight="Bold" FontSize="20" Background="{x:Null}" HorizontalContentAlignment="Center" VerticalContentAlignment="Center" Foreground="White"/>
  309. <!--<Label x:Name="AllOkNumLab" Content="{Binding AllOkNum}" HorizontalAlignment="Left" Margin="0,5,0,0" Width="100" FontWeight="Bold" FontSize="20" Background="{x:Null}" HorizontalContentAlignment="Center" VerticalContentAlignment="Center" Foreground="White"/>
  310. <Label x:Name="AllNgNumLab" Content="{Binding AllNgNum}" HorizontalAlignment="Left" Margin="0,5,0,0" Width="100" FontWeight="Bold" FontSize="20" Background="{x:Null}" HorizontalContentAlignment="Center" VerticalContentAlignment="Center" Foreground="White"/>-->
  311. <Label Content="{Binding BottingCount}" HorizontalAlignment="Left" Margin="0,5,0,0" Width="100" FontWeight="Bold" FontSize="20" Background="{x:Null}" HorizontalContentAlignment="Center" VerticalContentAlignment="Center" Foreground="White"/>
  312. </StackPanel>
  313. <StackPanel HorizontalAlignment="Left">
  314. <Label Content="{DynamicResource UnitGrain}" HorizontalAlignment="Left" Margin="10,5,0,0" VerticalAlignment="Top" FontWeight="Bold" FontSize="20" Foreground="White"/>
  315. <!--<Label Content="{DynamicResource UnitGrain}" HorizontalAlignment="Left" Margin="10,5,0,0" VerticalAlignment="Top" FontWeight="Bold" FontSize="20" Foreground="White"/>
  316. <Label Content="{DynamicResource UnitGrain}" HorizontalAlignment="Left" Margin="10,5,0,0" VerticalAlignment="Top" FontWeight="Bold" FontSize="20" Foreground="White"/>-->
  317. <Label Content="{DynamicResource UnitBottle}" HorizontalAlignment="Left" Margin="10,5,0,0" VerticalAlignment="Top" FontWeight="Bold" FontSize="20" Foreground="White"/>
  318. </StackPanel>
  319. </StackPanel>
  320. <Label x:Name="CamRunStaticLab" Content="{Binding CamRunStatic}" HorizontalAlignment="Left" Margin="10,0,10,5" VerticalAlignment="Bottom" Background="{x:Null}" FontSize="25" Foreground="{Binding CameraStaticColor}" FontWeight="Bold" />
  321. <Button x:Name="DataClear" Content="{DynamicResource ResetToZero}" BorderThickness="1" HorizontalAlignment="Right" Margin="10,0,10,12" Height="40" Style="{StaticResource BtnColor}" FontWeight="Bold" FontSize="20" Click="DataClear_Click" Cursor="Hand" VerticalAlignment="Bottom" MinWidth="80">
  322. <Button.Template>
  323. <ControlTemplate TargetType="Button">
  324. <Border CornerRadius="5"
  325. Background="{TemplateBinding Background}"
  326. BorderBrush="{TemplateBinding BorderBrush}"
  327. BorderThickness="{TemplateBinding BorderThickness}">
  328. <ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center"/>
  329. </Border>
  330. </ControlTemplate>
  331. </Button.Template>
  332. </Button>
  333. </Grid>
  334. <!-- 卡片内容 -->
  335. </Border>
  336. <Border Grid.Column="2"
  337. Height="160"
  338. Style="{StaticResource CardBackGround}"
  339. CornerRadius="8"
  340. BorderThickness="1"
  341. Margin="5,10,5,5" Cursor="" VerticalAlignment="Top">
  342. <Grid>
  343. <StackPanel Orientation="Vertical" HorizontalAlignment="Center" VerticalAlignment="Center">
  344. <StackPanel Orientation="Horizontal" HorizontalAlignment="Center">
  345. <TextBlock Text="{DynamicResource CurrentFormula}" FontWeight="Bold" FontSize="20" Margin="10,0,0,0" Foreground="White" HorizontalAlignment="Center" VerticalAlignment="Center" Width="170" TextAlignment="Center"/>
  346. <TextBox x:Name="FormulationName" Text="{Binding FormulationName,Mode=TwoWay,UpdateSourceTrigger=LostFocus}" Width="160" Height="40" Foreground="White" Background="{x:Null}" KeyDown="TextBox_KeyDown" FontSize="20" HorizontalAlignment="Center" VerticalAlignment="Center" GotFocus="FormulationName_GotFocus"/>
  347. <Button x:Name="SaveFormulationBtn" Content="{DynamicResource SaveFormula}" BorderThickness="1" HorizontalAlignment="Center" Margin="20,0,0,0" VerticalAlignment="Center" Width="140" Height="50" Style="{StaticResource BtnColor}" FontWeight="Bold" FontSize="20" Cursor="Hand" Click="SaveFormulationBtn_Click">
  348. <Button.Template>
  349. <ControlTemplate TargetType="Button">
  350. <Border CornerRadius="5" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}">
  351. <ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center"/>
  352. </Border>
  353. </ControlTemplate>
  354. </Button.Template>
  355. </Button>
  356. </StackPanel>
  357. <StackPanel Orientation="Horizontal" Margin="0,15,0,0" HorizontalAlignment="Center" VerticalAlignment="Center">
  358. <TextBlock Text="{DynamicResource SelectFormula}" FontWeight="Bold" FontSize="20" Margin="10,0,0,0" Foreground="White" HorizontalAlignment="Center" VerticalAlignment="Center" TextAlignment="Center" Width="170" />
  359. <ComboBox x:Name="FormulationCoBox" Height="40" Width="160" ItemsSource="{Binding FormulationItems}" HorizontalAlignment="Center" VerticalAlignment="Center" HorizontalContentAlignment="Center" FontSize="20">
  360. <ComboBox.Template>
  361. <ControlTemplate TargetType="ComboBox">
  362. <Grid>
  363. <ToggleButton
  364. Foreground="White"
  365. IsChecked="{Binding IsDropDownOpen, RelativeSource={RelativeSource TemplatedParent}}"
  366. ClickMode="Press">
  367. <ToggleButton.Template>
  368. <ControlTemplate TargetType="ToggleButton">
  369. <Border x:Name="Border" Background="#FF34495E" BorderBrush="#FFABADB3" BorderThickness="1">
  370. <Grid>
  371. <Grid.ColumnDefinitions>
  372. <ColumnDefinition />
  373. <ColumnDefinition Width="20" />
  374. </Grid.ColumnDefinitions>
  375. <ContentPresenter Grid.Column="0" Margin="3" />
  376. <Path x:Name="Arrow" Grid.Column="1"
  377. Fill="White"
  378. HorizontalAlignment="Center"
  379. VerticalAlignment="Center"
  380. Data="M 0 0 L 4 4 L 8 0 Z" />
  381. </Grid>
  382. </Border>
  383. <ControlTemplate.Triggers>
  384. <Trigger Property="IsMouseOver" Value="True">
  385. <Setter TargetName="Border" Property="Background" Value="LightBlue" />
  386. </Trigger>
  387. </ControlTemplate.Triggers>
  388. </ControlTemplate>
  389. </ToggleButton.Template>
  390. </ToggleButton>
  391. <ContentPresenter x:Name="ContentSite"
  392. IsHitTestVisible="False"
  393. Content="{TemplateBinding SelectionBoxItem}"
  394. ContentTemplate="{TemplateBinding SelectionBoxItemTemplate}"
  395. Margin="3,3,23,3"
  396. VerticalAlignment="Center"
  397. HorizontalAlignment="Left"
  398. TextBlock.Foreground="White"/>
  399. <Popup x:Name="Popup"
  400. Placement="Bottom"
  401. IsOpen="{TemplateBinding IsDropDownOpen}"
  402. AllowsTransparency="True"
  403. Focusable="False"
  404. PopupAnimation="Slide">
  405. <Border x:Name="DropDownBorder"
  406. Background="#FF34495E"
  407. BorderBrush="#FF34495E"
  408. BorderThickness="1">
  409. <ScrollViewer Margin="0,3,0,3"
  410. SnapsToDevicePixels="True">
  411. <ItemsPresenter KeyboardNavigation.DirectionalNavigation="Contained" />
  412. </ScrollViewer>
  413. </Border>
  414. </Popup>
  415. </Grid>
  416. </ControlTemplate>
  417. </ComboBox.Template>
  418. <ComboBox.ItemContainerStyle>
  419. <Style TargetType="ComboBoxItem">
  420. <Setter Property="Background" Value="#FF34495E" />
  421. <Setter Property="Foreground" Value="White" />
  422. <Style.Triggers>
  423. <Trigger Property="IsHighlighted" Value="True">
  424. <Setter Property="Background" Value="LightBlue" />
  425. </Trigger>
  426. </Style.Triggers>
  427. </Style>
  428. </ComboBox.ItemContainerStyle>
  429. </ComboBox>
  430. <Button x:Name="ReadFormulationBtn" Content="{DynamicResource ReadFormula}" BorderThickness="1" HorizontalAlignment="Center" Margin="20,0,0,0" VerticalAlignment="Center" Width="138" Height="50" Style="{StaticResource BtnColor}" FontWeight="Bold" FontSize="20" Cursor="Hand" Click="ReadFormulationBtn_Click">
  431. <Button.Template>
  432. <ControlTemplate TargetType="Button">
  433. <Border CornerRadius="5" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}">
  434. <ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center"/>
  435. </Border>
  436. </ControlTemplate>
  437. </Button.Template>
  438. </Button>
  439. </StackPanel>
  440. </StackPanel>
  441. </Grid>
  442. </Border>
  443. <Border Grid.Column="2"
  444. Style="{StaticResource CardBackGround}"
  445. CornerRadius="8"
  446. BorderThickness="1"
  447. Margin="5,180,5,0" Height="150" VerticalAlignment="Top">
  448. <StackPanel Orientation="Vertical" HorizontalAlignment="Center" VerticalAlignment="Center">
  449. <StackPanel Orientation="Horizontal" HorizontalAlignment="Center">
  450. <TextBlock Text="{DynamicResource ProductionBatch}" FontSize="20" Margin="0,0,20,0" VerticalAlignment="Center" Foreground="White" Width="170" TextAlignment="Center"/>
  451. <TextBox x:Name="BatchNumberTbx" Text="{Binding Source={x:Static BindNameSpace:ShowMessageBus.ShowBinding},Path = BatchNumber,Mode=TwoWay,UpdateSourceTrigger=LostFocus}" FontSize="16" Width="160" HorizontalContentAlignment="Center" VerticalContentAlignment="Center" Background="{x:Null}" Foreground="White" KeyDown="TextBox_KeyDown" Height="45" GotFocus="BatchNumberTbx_GotFocus"/>
  452. </StackPanel>
  453. <StackPanel Orientation="Horizontal" HorizontalAlignment="Center" Margin="0,10,0,0">
  454. <Button x:Name="StartIdentifyBtn" Content="{DynamicResource Start}" BorderThickness="1" HorizontalAlignment="Right" Margin="0,0,20,0" VerticalAlignment="Top" Width="100" Height="60" Style="{StaticResource BtnColor}" FontWeight="Bold" FontSize="20" Cursor="Hand" Click="StartIdentifyBtn_Click">
  455. <Button.Template>
  456. <ControlTemplate TargetType="Button">
  457. <Border CornerRadius="5" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}">
  458. <ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center"/>
  459. </Border>
  460. </ControlTemplate>
  461. </Button.Template>
  462. </Button>
  463. <Button x:Name="StopIdentifyBtn" Content="{DynamicResource Pause}" BorderThickness="1" HorizontalAlignment="Right" Margin="0,0,0,0" VerticalAlignment="Top" Width="100" Height="60" Style="{StaticResource BtnColor}" FontWeight="Bold" FontSize="20" Cursor="Hand" Click="StopIdentifyBtn_Click">
  464. <Button.Template>
  465. <ControlTemplate TargetType="Button">
  466. <Border CornerRadius="5" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}">
  467. <ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center"/>
  468. </Border>
  469. </ControlTemplate>
  470. </Button.Template>
  471. </Button>
  472. </StackPanel>
  473. </StackPanel>
  474. </Border>
  475. </Grid>
  476. </Grid>
  477. </Page>