终端一体化运控平台
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符
 
 
 

526 行
27 KiB

  1. <Window
  2. x:Class="BPASmartClient.DosingSystem.View.NewMaterialDeviceParView"
  3. xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  4. xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  5. xmlns:Themes1="clr-namespace:Microsoft.Windows.Themes;assembly=PresentationFramework.Classic"
  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:vm="clr-namespace:BPASmartClient.DosingSystem.ViewModel"
  10. Title="NewMaterialDeviceParView"
  11. Width="550"
  12. Height="450"
  13. AllowsTransparency="True"
  14. Background="{x:Null}"
  15. Topmost="True"
  16. WindowStartupLocation="CenterScreen"
  17. WindowStyle="None"
  18. mc:Ignorable="d">
  19. <Window.DataContext>
  20. <vm:NewMaterialDeviceParViewModel />
  21. </Window.DataContext>
  22. <Window.Resources>
  23. <ResourceDictionary>
  24. <ResourceDictionary.MergedDictionaries>
  25. <ResourceDictionary Source="/BPASmartClient.CustomResource;component/Themes/GenricStyle.xaml" />
  26. <ResourceDictionary Source="/BPASmartClient.CustomResource;component/Themes/MyStyle.xaml" />
  27. <ResourceDictionary>
  28. <!--#region ListBox样式-->
  29. <Style x:Key="ListBoxItemStyle1" TargetType="{x:Type ListBoxItem}">
  30. <Setter Property="OverridesDefaultStyle" Value="True" />
  31. <Setter Property="SnapsToDevicePixels" Value="True" />
  32. <Setter Property="BorderBrush" Value="{x:Null}" />
  33. <Setter Property="Foreground" Value="White" />
  34. <Setter Property="FontSize" Value="20" />
  35. <Setter Property="HorizontalContentAlignment" Value="Center" />
  36. <Setter Property="VerticalContentAlignment" Value="Center" />
  37. <Setter Property="Template">
  38. <Setter.Value>
  39. <ControlTemplate TargetType="{x:Type ListBoxItem}">
  40. <Border x:Name="border" CornerRadius="8">
  41. <ContentPresenter HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" />
  42. </Border>
  43. </ControlTemplate>
  44. </Setter.Value>
  45. </Setter>
  46. </Style>
  47. <!--#endregion-->
  48. <!--#region Combox 样式-->
  49. <Style x:Key="ComboBoxStyle1" TargetType="{x:Type ComboBox}">
  50. <Setter Property="FocusVisualStyle" Value="{StaticResource ComboBoxFocusVisual}" />
  51. <Setter Property="Foreground" Value="{DynamicResource foreground}" />
  52. <Setter Property="Background" Value="Transparent" />
  53. <Setter Property="BorderBrush" Value="{DynamicResource borderBrush}" />
  54. <Setter Property="BorderThickness" Value="1" />
  55. <Setter Property="Margin" Value="0,0,0,0" />
  56. <Setter Property="Padding" Value="0" />
  57. <Setter Property="Height" Value="24" />
  58. <Setter Property="ScrollViewer.HorizontalScrollBarVisibility" Value="Auto" />
  59. <Setter Property="ScrollViewer.VerticalScrollBarVisibility" Value="Auto" />
  60. <Setter Property="ScrollViewer.CanContentScroll" Value="true" />
  61. <Setter Property="ScrollViewer.PanningMode" Value="Both" />
  62. <Setter Property="Stylus.IsFlicksEnabled" Value="False" />
  63. <Setter Property="VerticalContentAlignment" Value="Center" />
  64. <Setter Property="IsTextSearchCaseSensitive" Value="true" />
  65. <Setter Property="IsEditable" Value="true" />
  66. <Setter Property="StaysOpenOnEdit" Value="true" />
  67. <Setter Property="Template">
  68. <Setter.Value>
  69. <ControlTemplate TargetType="{x:Type ComboBox}">
  70. <Border
  71. Background="{TemplateBinding Background}"
  72. BorderBrush="{TemplateBinding BorderBrush}"
  73. BorderThickness="{TemplateBinding BorderThickness}"
  74. SnapsToDevicePixels="true">
  75. <Grid>
  76. <Themes1:ClassicBorderDecorator
  77. x:Name="Border"
  78. BorderBrush="{x:Static Themes1:ClassicBorderDecorator.ClassicBorderBrush}"
  79. BorderStyle="None"
  80. BorderThickness="2">
  81. <Popup
  82. x:Name="PART_Popup"
  83. AllowsTransparency="true"
  84. Focusable="False"
  85. IsOpen="{TemplateBinding IsDropDownOpen}"
  86. Placement="Bottom"
  87. PopupAnimation="{DynamicResource {x:Static SystemParameters.ComboBoxPopupAnimationKey}}">
  88. <Themes1:SystemDropShadowChrome
  89. x:Name="Shdw"
  90. MinWidth="{Binding ActualWidth, ElementName=Border}"
  91. MaxHeight="{TemplateBinding MaxDropDownHeight}"
  92. Color="Transparent">
  93. <Border
  94. x:Name="DropDownBorder"
  95. BorderBrush="{DynamicResource {x:Static SystemColors.WindowFrameBrushKey}}"
  96. BorderThickness="1">
  97. <Border.Background>
  98. <SolidColorBrush Color="#264c73" />
  99. </Border.Background>
  100. <ScrollViewer x:Name="DropDownScrollViewer">
  101. <Grid RenderOptions.ClearTypeHint="Enabled">
  102. <Canvas
  103. Width="0"
  104. Height="0"
  105. HorizontalAlignment="Left"
  106. VerticalAlignment="Top">
  107. <Rectangle
  108. x:Name="OpaqueRect"
  109. Width="{Binding ActualWidth, ElementName=DropDownBorder}"
  110. Height="{Binding ActualHeight, ElementName=DropDownBorder}"
  111. Fill="{Binding Background, ElementName=DropDownBorder}" />
  112. </Canvas>
  113. <ItemsPresenter
  114. x:Name="ItemsPresenter"
  115. KeyboardNavigation.DirectionalNavigation="Contained"
  116. SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
  117. </Grid>
  118. </ScrollViewer>
  119. </Border>
  120. </Themes1:SystemDropShadowChrome>
  121. </Popup>
  122. </Themes1:ClassicBorderDecorator>
  123. <DockPanel Margin="2">
  124. <FrameworkElement Width="{DynamicResource {x:Static SystemParameters.VerticalScrollBarWidthKey}}" DockPanel.Dock="Right" />
  125. <Border x:Name="SelectedItemBorder" Margin="{TemplateBinding Padding}">
  126. <ContentPresenter
  127. Margin="1,1,1,1"
  128. HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
  129. VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
  130. Content="{TemplateBinding SelectionBoxItem}"
  131. ContentStringFormat="{TemplateBinding SelectionBoxItemStringFormat}"
  132. ContentTemplate="{TemplateBinding SelectionBoxItemTemplate}"
  133. ContentTemplateSelector="{TemplateBinding ItemTemplateSelector}"
  134. SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
  135. </Border>
  136. </DockPanel>
  137. <ToggleButton
  138. Width="Auto"
  139. MinWidth="0"
  140. MinHeight="0"
  141. Margin="2"
  142. ClickMode="Press"
  143. Focusable="false"
  144. IsChecked="{Binding IsDropDownOpen, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}"
  145. Style="{StaticResource ComboBoxTransparentButtonStyle}" />
  146. </Grid>
  147. </Border>
  148. <ControlTemplate.Triggers>
  149. <MultiTrigger>
  150. <MultiTrigger.Conditions>
  151. <Condition Property="IsDropDownOpen" Value="false" />
  152. </MultiTrigger.Conditions>
  153. <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.HighlightTextBrushKey}}" />
  154. </MultiTrigger>
  155. <Trigger Property="HasItems" Value="false">
  156. <Setter TargetName="DropDownBorder" Property="MinHeight" Value="95" />
  157. </Trigger>
  158. <Trigger Property="IsEnabled" Value="false">
  159. <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.GrayTextBrushKey}}" />
  160. <Setter Property="Background" Value="{DynamicResource {x:Static SystemColors.ControlBrushKey}}" />
  161. </Trigger>
  162. <MultiTrigger>
  163. <MultiTrigger.Conditions>
  164. <Condition Property="IsGrouping" Value="true" />
  165. <Condition Property="VirtualizingPanel.IsVirtualizingWhenGrouping" Value="false" />
  166. </MultiTrigger.Conditions>
  167. <Setter Property="ScrollViewer.CanContentScroll" Value="false" />
  168. </MultiTrigger>
  169. <Trigger SourceName="PART_Popup" Property="HasDropShadow" Value="true">
  170. <Setter TargetName="Shdw" Property="Margin" Value="0,0,5,5" />
  171. <Setter TargetName="Shdw" Property="Color" Value="#71000000" />
  172. </Trigger>
  173. <Trigger SourceName="DropDownScrollViewer" Property="ScrollViewer.CanContentScroll" Value="false">
  174. <Setter TargetName="OpaqueRect" Property="Canvas.Top" Value="{Binding VerticalOffset, ElementName=DropDownScrollViewer}" />
  175. <Setter TargetName="OpaqueRect" Property="Canvas.Left" Value="{Binding HorizontalOffset, ElementName=DropDownScrollViewer}" />
  176. </Trigger>
  177. </ControlTemplate.Triggers>
  178. </ControlTemplate>
  179. </Setter.Value>
  180. </Setter>
  181. <Style.Triggers>
  182. <Trigger Property="IsEditable" Value="true">
  183. <Setter Property="IsTabStop" Value="false" />
  184. <Setter Property="Padding" Value="1" />
  185. <Setter Property="Template" Value="{StaticResource ComboBoxEditableTemplate}" />
  186. </Trigger>
  187. </Style.Triggers>
  188. </Style>
  189. <!--#endregion-->
  190. </ResourceDictionary>
  191. </ResourceDictionary.MergedDictionaries>
  192. </ResourceDictionary>
  193. </Window.Resources>
  194. <Border
  195. Name="br"
  196. BorderBrush="#0CADF5"
  197. BorderThickness="2">
  198. <Border.Background>
  199. <ImageBrush ImageSource="/BPASmartClient.CustomResource;component/Image/bg.png" />
  200. </Border.Background>
  201. <Grid>
  202. <Grid.RowDefinitions>
  203. <RowDefinition Height="5" />
  204. <RowDefinition />
  205. </Grid.RowDefinitions>
  206. <Grid Grid.Row="1">
  207. <Grid.RowDefinitions>
  208. <RowDefinition Height="40" />
  209. <RowDefinition />
  210. </Grid.RowDefinitions>
  211. <TextBlock
  212. Margin="0,0,10,0"
  213. HorizontalAlignment="Right"
  214. Background="Transparent"
  215. FontSize="16"
  216. Foreground="Red"
  217. Text="{Binding ErrorInfo}" />
  218. <Grid Grid.Row="1" Margin="5">
  219. <Grid.RowDefinitions>
  220. <RowDefinition />
  221. <RowDefinition />
  222. <RowDefinition />
  223. <RowDefinition />
  224. <RowDefinition />
  225. <RowDefinition />
  226. <RowDefinition />
  227. <RowDefinition />
  228. <RowDefinition />
  229. </Grid.RowDefinitions>
  230. <Grid.ColumnDefinitions>
  231. <ColumnDefinition />
  232. <ColumnDefinition />
  233. <ColumnDefinition />
  234. </Grid.ColumnDefinitions>
  235. <!--#region 请输入原料名称-->
  236. <TextBlock
  237. Grid.Column="0"
  238. HorizontalAlignment="Right"
  239. Background="Transparent"
  240. FontSize="20"
  241. Foreground="#FF2AB2E7"
  242. Text="请输入原料名称:" />
  243. <!--<TextBox
  244. Grid.Column="1"
  245. Margin="3"
  246. Style="{StaticResource TextBoxStyle}"
  247. Text="{Binding RawMaterialName}" />-->
  248. <ComboBox
  249. Grid.Column="1"
  250. Margin="3"
  251. FontSize="14"
  252. ItemsSource="{Binding DataContext.materialNames, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=ItemsControl}}"
  253. KeyUp="ComboBox_KeyUp"
  254. LostFocus="ComboBox_LostFocus"
  255. Style="{StaticResource ComboBoxStyle1}"
  256. Text="{Binding MaterialName}">
  257. <ComboBox.ItemContainerStyle>
  258. <Style TargetType="{x:Type ComboBoxItem}">
  259. <Setter Property="Background" Value="White" />
  260. <Setter Property="Foreground" Value="#e69519" />
  261. </Style>
  262. </ComboBox.ItemContainerStyle>
  263. </ComboBox>
  264. <StackPanel Grid.Column="2" Orientation="Horizontal">
  265. <Button
  266. Width="80"
  267. Height="30"
  268. Command="{Binding SaveCommand}"
  269. Content="确认" />
  270. <Button
  271. Name="btClose"
  272. Width="80"
  273. Height="30"
  274. Margin="7,0,0,0"
  275. Content="取消" />
  276. </StackPanel>
  277. <!--#endregion-->
  278. <!--#region 慢加重量-->
  279. <TextBlock
  280. Grid.Row="1"
  281. Grid.Column="0"
  282. HorizontalAlignment="Right"
  283. Background="Transparent"
  284. FontSize="20"
  285. Foreground="#FF2AB2E7"
  286. Text="慢加重量:" />
  287. <TextBox
  288. Grid.Row="1"
  289. Grid.Column="1"
  290. Margin="3"
  291. Style="{StaticResource TextBoxStyle}"
  292. Text="{Binding RawMaterialName}" />
  293. <TextBlock
  294. Grid.Row="1"
  295. Grid.Column="2"
  296. Margin="5,0,0,0"
  297. HorizontalAlignment="Left"
  298. Background="Transparent"
  299. FontSize="20"
  300. Foreground="#FF2AB2E7"
  301. Text="g" />
  302. <!--#endregion-->
  303. <!--#region 提前关阀重量-->
  304. <TextBlock
  305. Grid.Row="2"
  306. Grid.Column="0"
  307. HorizontalAlignment="Right"
  308. Background="Transparent"
  309. FontSize="20"
  310. Foreground="#FF2AB2E7"
  311. Text="提前关阀重量:" />
  312. <TextBox
  313. Grid.Row="2"
  314. Grid.Column="1"
  315. Margin="3"
  316. Style="{StaticResource TextBoxStyle}"
  317. Text="{Binding RawMaterialName}" />
  318. <TextBlock
  319. Grid.Row="2"
  320. Grid.Column="2"
  321. Margin="5,0,0,0"
  322. HorizontalAlignment="Left"
  323. Background="Transparent"
  324. FontSize="20"
  325. Foreground="#FF2AB2E7"
  326. Text="g" />
  327. <!--#endregion-->
  328. <!--#region 快加速度-->
  329. <TextBlock
  330. Grid.Row="3"
  331. Grid.Column="0"
  332. HorizontalAlignment="Right"
  333. Background="Transparent"
  334. FontSize="20"
  335. Foreground="#FF2AB2E7"
  336. Text="快加速度:" />
  337. <TextBox
  338. Grid.Row="3"
  339. Grid.Column="1"
  340. Margin="3"
  341. Style="{StaticResource TextBoxStyle}"
  342. Text="{Binding RawMaterialName}" />
  343. <TextBlock
  344. Grid.Row="3"
  345. Grid.Column="2"
  346. Margin="5,0,0,0"
  347. HorizontalAlignment="Left"
  348. Background="Transparent"
  349. FontSize="20"
  350. Foreground="#FF2AB2E7"
  351. Text="单位" />
  352. <!--#endregion-->
  353. <!--#region 慢加速度-->
  354. <TextBlock
  355. Grid.Row="4"
  356. Grid.Column="0"
  357. HorizontalAlignment="Right"
  358. Background="Transparent"
  359. FontSize="20"
  360. Foreground="#FF2AB2E7"
  361. Text="慢加速度:" />
  362. <TextBox
  363. Grid.Row="4"
  364. Grid.Column="1"
  365. Margin="3"
  366. Style="{StaticResource TextBoxStyle}"
  367. Text="{Binding RawMaterialName}" />
  368. <TextBlock
  369. Grid.Row="4"
  370. Grid.Column="2"
  371. Margin="5,0,0,0"
  372. HorizontalAlignment="Left"
  373. Background="Transparent"
  374. FontSize="20"
  375. Foreground="#FF2AB2E7"
  376. Text="单位" />
  377. <!--#endregion-->
  378. <!--#region 伺服手动速度-->
  379. <TextBlock
  380. Grid.Row="5"
  381. Grid.Column="0"
  382. HorizontalAlignment="Right"
  383. Background="Transparent"
  384. FontSize="20"
  385. Foreground="#FF2AB2E7"
  386. Text="伺服手动速度:" />
  387. <TextBox
  388. Grid.Row="5"
  389. Grid.Column="1"
  390. Margin="3"
  391. Style="{StaticResource TextBoxStyle}"
  392. Text="{Binding RawMaterialName}" />
  393. <TextBlock
  394. Grid.Row="5"
  395. Grid.Column="2"
  396. Margin="5,0,0,0"
  397. HorizontalAlignment="Left"
  398. Background="Transparent"
  399. FontSize="20"
  400. Foreground="#FF2AB2E7"
  401. Text="单位" />
  402. <!--#endregion-->
  403. <!--#region 料仓上限重量-->
  404. <TextBlock
  405. Grid.Row="6"
  406. Grid.Column="0"
  407. HorizontalAlignment="Right"
  408. Background="Transparent"
  409. FontSize="20"
  410. Foreground="#FF2AB2E7"
  411. Text="料仓上限重量:" />
  412. <TextBox
  413. Grid.Row="6"
  414. Grid.Column="1"
  415. Margin="3"
  416. Style="{StaticResource TextBoxStyle}"
  417. Text="{Binding RawMaterialName}" />
  418. <TextBlock
  419. Grid.Row="6"
  420. Grid.Column="2"
  421. Margin="5,0,0,0"
  422. HorizontalAlignment="Left"
  423. Background="Transparent"
  424. FontSize="20"
  425. Foreground="#FF2AB2E7"
  426. Text="g" />
  427. <!--#endregion-->
  428. <!--#region 料仓下限重量-->
  429. <TextBlock
  430. Grid.Row="7"
  431. Grid.Column="0"
  432. HorizontalAlignment="Right"
  433. Background="Transparent"
  434. FontSize="20"
  435. Foreground="#FF2AB2E7"
  436. Text="料仓下限重量:" />
  437. <TextBox
  438. Grid.Row="7"
  439. Grid.Column="1"
  440. Margin="3"
  441. Style="{StaticResource TextBoxStyle}"
  442. Text="{Binding RawMaterialName}" />
  443. <TextBlock
  444. Grid.Row="7"
  445. Grid.Column="2"
  446. Margin="5,0,0,0"
  447. HorizontalAlignment="Left"
  448. Background="Transparent"
  449. FontSize="20"
  450. Foreground="#FF2AB2E7"
  451. Text="g" />
  452. <!--#endregion-->
  453. <!--#region 搅拌速度-->
  454. <TextBlock
  455. Grid.Row="8"
  456. Grid.Column="0"
  457. HorizontalAlignment="Right"
  458. Background="Transparent"
  459. FontSize="20"
  460. Foreground="#FF2AB2E7"
  461. Text="搅拌速度:" />
  462. <TextBox
  463. Grid.Row="8"
  464. Grid.Column="1"
  465. Margin="3"
  466. Style="{StaticResource TextBoxStyle}"
  467. Text="{Binding RawMaterialName}" />
  468. <TextBlock
  469. Grid.Row="8"
  470. Grid.Column="2"
  471. Margin="5,0,0,0"
  472. HorizontalAlignment="Left"
  473. Background="Transparent"
  474. FontSize="20"
  475. Foreground="#FF2AB2E7"
  476. Text="单位" />
  477. <!--#endregion-->
  478. </Grid>
  479. </Grid>
  480. </Grid>
  481. </Border>
  482. </Window>