终端一体化运控平台
25개 이상의 토픽을 선택하실 수 없습니다. Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

CommParSetView.xaml 23 KiB

1 년 전
1 년 전
1 년 전
2 년 전
1 년 전
1 년 전
2 년 전
2 년 전
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438
  1. <UserControl
  2. x:Class="BPASmartClient.DosingSystem.View.CommParSetView"
  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.DosingSystem.View"
  7. xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
  8. xmlns:vm="clr-namespace:BPASmartClient.DosingSystem.ViewModel"
  9. xmlns:Themes1="clr-namespace:Microsoft.Windows.Themes;assembly=PresentationFramework.Classic"
  10. d:DesignHeight="450"
  11. d:DesignWidth="800"
  12. mc:Ignorable="d">
  13. <UserControl.DataContext>
  14. <vm:CommparSetViewModel />
  15. </UserControl.DataContext>
  16. <UserControl.Resources>
  17. <ResourceDictionary>
  18. <ResourceDictionary.MergedDictionaries>
  19. <ResourceDictionary Source="/BPASmartClient.CustomResource;component/Themes/GenricStyle.xaml" />
  20. <ResourceDictionary Source="/BPASmartClient.CustomResource;component/Themes/MyStyle.xaml" />
  21. <ResourceDictionary>
  22. <SolidColorBrush x:Key="foreground" Color="#009DFF" />
  23. <SolidColorBrush x:Key="borderBrush" Color="#009DFF" />
  24. <Style x:Key="ComboBoxStyle1" TargetType="{x:Type ComboBox}">
  25. <Setter Property="FocusVisualStyle" Value="{StaticResource ComboBoxFocusVisual}" />
  26. <Setter Property="Foreground" Value="{DynamicResource foreground}" />
  27. <Setter Property="Background" Value="Transparent" />
  28. <Setter Property="BorderBrush" Value="{DynamicResource borderBrush}" />
  29. <Setter Property="BorderThickness" Value="1" />
  30. <Setter Property="Margin" Value="0,0,0,0" />
  31. <Setter Property="Padding" Value="0" />
  32. <Setter Property="Height" Value="24" />
  33. <Setter Property="ScrollViewer.HorizontalScrollBarVisibility" Value="Auto" />
  34. <Setter Property="ScrollViewer.VerticalScrollBarVisibility" Value="Auto" />
  35. <Setter Property="ScrollViewer.CanContentScroll" Value="true" />
  36. <Setter Property="ScrollViewer.PanningMode" Value="Both" />
  37. <Setter Property="Stylus.IsFlicksEnabled" Value="False" />
  38. <Setter Property="VerticalContentAlignment" Value="Center" />
  39. <Setter Property="IsTextSearchCaseSensitive" Value="true" />
  40. <Setter Property="IsEditable" Value="true" />
  41. <Setter Property="StaysOpenOnEdit" Value="true" />
  42. <Setter Property="Template">
  43. <Setter.Value>
  44. <ControlTemplate TargetType="{x:Type ComboBox}">
  45. <Border
  46. Background="{TemplateBinding Background}"
  47. BorderBrush="{TemplateBinding BorderBrush}"
  48. BorderThickness="{TemplateBinding BorderThickness}"
  49. SnapsToDevicePixels="true">
  50. <Grid>
  51. <Themes1:ClassicBorderDecorator
  52. x:Name="Border"
  53. BorderBrush="{x:Static Themes1:ClassicBorderDecorator.ClassicBorderBrush}"
  54. BorderStyle="None"
  55. BorderThickness="2">
  56. <Popup
  57. x:Name="PART_Popup"
  58. AllowsTransparency="true"
  59. Focusable="False"
  60. IsOpen="{TemplateBinding IsDropDownOpen}"
  61. Placement="Bottom"
  62. PopupAnimation="{DynamicResource {x:Static SystemParameters.ComboBoxPopupAnimationKey}}">
  63. <Themes1:SystemDropShadowChrome
  64. x:Name="Shdw"
  65. MinWidth="{Binding ActualWidth, ElementName=Border}"
  66. MaxHeight="{TemplateBinding MaxDropDownHeight}"
  67. Color="Transparent">
  68. <Border
  69. x:Name="DropDownBorder"
  70. BorderBrush="{DynamicResource {x:Static SystemColors.WindowFrameBrushKey}}"
  71. BorderThickness="1">
  72. <Border.Background>
  73. <SolidColorBrush Color="#264c73" />
  74. </Border.Background>
  75. <ScrollViewer x:Name="DropDownScrollViewer">
  76. <Grid RenderOptions.ClearTypeHint="Enabled">
  77. <Canvas
  78. Width="0"
  79. Height="0"
  80. HorizontalAlignment="Left"
  81. VerticalAlignment="Top">
  82. <Rectangle
  83. x:Name="OpaqueRect"
  84. Width="{Binding ActualWidth, ElementName=DropDownBorder}"
  85. Height="{Binding ActualHeight, ElementName=DropDownBorder}"
  86. Fill="{Binding Background, ElementName=DropDownBorder}" />
  87. </Canvas>
  88. <ItemsPresenter
  89. x:Name="ItemsPresenter"
  90. KeyboardNavigation.DirectionalNavigation="Contained"
  91. SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
  92. </Grid>
  93. </ScrollViewer>
  94. </Border>
  95. </Themes1:SystemDropShadowChrome>
  96. </Popup>
  97. </Themes1:ClassicBorderDecorator>
  98. <DockPanel Margin="2">
  99. <FrameworkElement Width="{DynamicResource {x:Static SystemParameters.VerticalScrollBarWidthKey}}" DockPanel.Dock="Right" />
  100. <Border x:Name="SelectedItemBorder" Margin="{TemplateBinding Padding}">
  101. <ContentPresenter
  102. Margin="1,1,1,1"
  103. HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
  104. VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
  105. Content="{TemplateBinding SelectionBoxItem}"
  106. ContentStringFormat="{TemplateBinding SelectionBoxItemStringFormat}"
  107. ContentTemplate="{TemplateBinding SelectionBoxItemTemplate}"
  108. ContentTemplateSelector="{TemplateBinding ItemTemplateSelector}"
  109. SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
  110. </Border>
  111. </DockPanel>
  112. <ToggleButton
  113. Width="Auto"
  114. MinWidth="0"
  115. MinHeight="0"
  116. Margin="2"
  117. ClickMode="Press"
  118. Focusable="false"
  119. IsChecked="{Binding IsDropDownOpen, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}"
  120. Style="{StaticResource ComboBoxTransparentButtonStyle}" />
  121. </Grid>
  122. </Border>
  123. <ControlTemplate.Triggers>
  124. <MultiTrigger>
  125. <MultiTrigger.Conditions>
  126. <Condition Property="IsDropDownOpen" Value="false" />
  127. </MultiTrigger.Conditions>
  128. <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.HighlightTextBrushKey}}" />
  129. </MultiTrigger>
  130. <Trigger Property="HasItems" Value="false">
  131. <Setter TargetName="DropDownBorder" Property="MinHeight" Value="95" />
  132. </Trigger>
  133. <Trigger Property="IsEnabled" Value="false">
  134. <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.GrayTextBrushKey}}" />
  135. <Setter Property="Background" Value="{DynamicResource {x:Static SystemColors.ControlBrushKey}}" />
  136. </Trigger>
  137. <MultiTrigger>
  138. <MultiTrigger.Conditions>
  139. <Condition Property="IsGrouping" Value="true" />
  140. <Condition Property="VirtualizingPanel.IsVirtualizingWhenGrouping" Value="false" />
  141. </MultiTrigger.Conditions>
  142. <Setter Property="ScrollViewer.CanContentScroll" Value="false" />
  143. </MultiTrigger>
  144. <Trigger SourceName="PART_Popup" Property="HasDropShadow" Value="true">
  145. <Setter TargetName="Shdw" Property="Margin" Value="0,0,5,5" />
  146. <Setter TargetName="Shdw" Property="Color" Value="#71000000" />
  147. </Trigger>
  148. <Trigger SourceName="DropDownScrollViewer" Property="ScrollViewer.CanContentScroll" Value="false">
  149. <Setter TargetName="OpaqueRect" Property="Canvas.Top" Value="{Binding VerticalOffset, ElementName=DropDownScrollViewer}" />
  150. <Setter TargetName="OpaqueRect" Property="Canvas.Left" Value="{Binding HorizontalOffset, ElementName=DropDownScrollViewer}" />
  151. </Trigger>
  152. </ControlTemplate.Triggers>
  153. </ControlTemplate>
  154. </Setter.Value>
  155. </Setter>
  156. <Style.Triggers>
  157. <Trigger Property="IsEditable" Value="true">
  158. <Setter Property="IsTabStop" Value="false" />
  159. <Setter Property="Padding" Value="1" />
  160. <Setter Property="Template" Value="{StaticResource ComboBoxEditableTemplate}" />
  161. </Trigger>
  162. </Style.Triggers>
  163. </Style>
  164. </ResourceDictionary>
  165. </ResourceDictionary.MergedDictionaries>
  166. </ResourceDictionary>
  167. </UserControl.Resources>
  168. <Grid>
  169. <Grid.RowDefinitions>
  170. <RowDefinition Height="50" />
  171. <RowDefinition />
  172. </Grid.RowDefinitions>
  173. <Grid.ColumnDefinitions>
  174. <ColumnDefinition />
  175. <ColumnDefinition />
  176. <ColumnDefinition />
  177. <ColumnDefinition />
  178. </Grid.ColumnDefinitions>
  179. <Button
  180. Grid.Column="3"
  181. Width="120"
  182. Height="30"
  183. Margin="5,0,5,0"
  184. HorizontalAlignment="Left"
  185. Command="{Binding SaveCommand}"
  186. Content="保存参数"
  187. FontSize="20"
  188. Style="{StaticResource ImageButtonStyle}" />
  189. <WrapPanel Grid.Row="1" Grid.ColumnSpan="4">
  190. <Grid Width="350" Margin="5">
  191. <Grid.ColumnDefinitions>
  192. <ColumnDefinition />
  193. <ColumnDefinition />
  194. </Grid.ColumnDefinitions>
  195. <TextBlock
  196. Margin="0,0,2,0"
  197. HorizontalAlignment="Right"
  198. Style="{StaticResource TextBlockStyle}"
  199. Text="配料设备网段:" />
  200. <TextBox
  201. Grid.Column="1"
  202. Width="170"
  203. Height="35"
  204. HorizontalAlignment="Right"
  205. FontSize="20"
  206. Style="{StaticResource TextBoxStyle}"
  207. Text="{Binding CommBaseParModel.NetworkSegAddress, UpdateSourceTrigger=PropertyChanged}" />
  208. </Grid>
  209. <Grid Width="350" Margin="5">
  210. <Grid.ColumnDefinitions>
  211. <ColumnDefinition />
  212. <ColumnDefinition />
  213. </Grid.ColumnDefinitions>
  214. <TextBlock
  215. Margin="0,0,2,0"
  216. HorizontalAlignment="Right"
  217. Style="{StaticResource TextBlockStyle}"
  218. Text="输送带PLC地址:" />
  219. <TextBox
  220. Grid.Column="1"
  221. Width="170"
  222. Height="35"
  223. HorizontalAlignment="Right"
  224. FontSize="20"
  225. Style="{StaticResource TextBoxStyle}"
  226. Text="{Binding CommBaseParModel.DeviceAddress, UpdateSourceTrigger=PropertyChanged}" />
  227. </Grid>
  228. <Grid Width="350" Margin="5">
  229. <Grid.ColumnDefinitions>
  230. <ColumnDefinition />
  231. <ColumnDefinition />
  232. </Grid.ColumnDefinitions>
  233. <TextBlock
  234. Margin="0,0,2,0"
  235. HorizontalAlignment="Right"
  236. Style="{StaticResource TextBlockStyle}"
  237. Text="输送线类型:" />
  238. <ComboBox
  239. Grid.Column="1"
  240. Width="170"
  241. Height="35"
  242. HorizontalAlignment="Right"
  243. FontSize="20"
  244. Text="{Binding CommBaseParModel.ConveryType,UpdateSourceTrigger=PropertyChanged}"
  245. ItemsSource="{Binding CommBaseParModel.ConveryTypeList,UpdateSourceTrigger=PropertyChanged}">
  246. <ComboBox.ItemContainerStyle>
  247. <Style TargetType="{x:Type ComboBoxItem}">
  248. <Setter Property="Background" Value="Transparent" />
  249. <Setter Property="Foreground" Value="#009DFF" />
  250. </Style>
  251. </ComboBox.ItemContainerStyle>
  252. </ComboBox>
  253. <!--<TextBox
  254. Grid.Column="1"
  255. Width="170"
  256. Height="35"
  257. HorizontalAlignment="Right"
  258. FontSize="20"
  259. Style="{StaticResource TextBoxStyle}"
  260. Text="{Binding CommBaseParModel.StockCount, UpdateSourceTrigger=PropertyChanged}" />-->
  261. </Grid>
  262. <Grid Width="350" Margin="5">
  263. <Grid.ColumnDefinitions>
  264. <ColumnDefinition />
  265. <ColumnDefinition />
  266. </Grid.ColumnDefinitions>
  267. <TextBlock
  268. Margin="0,0,2,0"
  269. HorizontalAlignment="Right"
  270. Style="{StaticResource TextBlockStyle}"
  271. Text="料仓数量:" />
  272. <TextBox
  273. Grid.Column="1"
  274. Width="170"
  275. Height="35"
  276. HorizontalAlignment="Right"
  277. FontSize="20"
  278. Style="{StaticResource TextBoxStyle}"
  279. Text="{Binding CommBaseParModel.StockCount, UpdateSourceTrigger=PropertyChanged}" />
  280. </Grid>
  281. <Grid Width="350" Margin="5">
  282. <Grid.ColumnDefinitions>
  283. <ColumnDefinition />
  284. <ColumnDefinition />
  285. </Grid.ColumnDefinitions>
  286. <TextBlock
  287. Margin="0,0,2,0"
  288. HorizontalAlignment="Right"
  289. Style="{StaticResource TextBlockStyle}"
  290. Text="升降气缸数量:" />
  291. <TextBox
  292. Grid.Column="1"
  293. Width="170"
  294. Height="35"
  295. HorizontalAlignment="Right"
  296. FontSize="20"
  297. Style="{StaticResource TextBoxStyle}"
  298. Text="{Binding CommBaseParModel.LiftCylinderCount, UpdateSourceTrigger=PropertyChanged}" />
  299. </Grid>
  300. <Grid Width="350" Margin="5">
  301. <Grid.ColumnDefinitions>
  302. <ColumnDefinition />
  303. <ColumnDefinition />
  304. </Grid.ColumnDefinitions>
  305. <TextBlock
  306. Margin="0,0,2,0"
  307. HorizontalAlignment="Right"
  308. Style="{StaticResource TextBlockStyle}"
  309. Text="阻挡气缸数量:" />
  310. <TextBox
  311. Grid.Column="1"
  312. Width="170"
  313. Height="35"
  314. HorizontalAlignment="Right"
  315. FontSize="20"
  316. Style="{StaticResource TextBoxStyle}"
  317. Text="{Binding CommBaseParModel.BlockCylinderCount, UpdateSourceTrigger=PropertyChanged}" />
  318. </Grid>
  319. <Grid
  320. Width="350"
  321. Margin="5"
  322. Background="Transparent">
  323. <Grid.ColumnDefinitions>
  324. <ColumnDefinition />
  325. <ColumnDefinition />
  326. </Grid.ColumnDefinitions>
  327. <TextBlock
  328. Margin="0,0,2,0"
  329. HorizontalAlignment="Right"
  330. Style="{StaticResource TextBlockStyle}"
  331. Text="托盘气缸数量:" />
  332. <TextBox
  333. Grid.Column="1"
  334. Width="170"
  335. Height="35"
  336. HorizontalAlignment="Right"
  337. FontSize="20"
  338. Style="{StaticResource TextBoxStyle}"
  339. Text="{Binding CommBaseParModel.PalletCylinderCount, UpdateSourceTrigger=PropertyChanged}" />
  340. </Grid>
  341. <Grid
  342. Width="350"
  343. Margin="5"
  344. Background="Transparent">
  345. <Grid.ColumnDefinitions>
  346. <ColumnDefinition />
  347. <ColumnDefinition />
  348. </Grid.ColumnDefinitions>
  349. <TextBlock
  350. Margin="0,0,2,0"
  351. HorizontalAlignment="Right"
  352. Style="{StaticResource TextBlockStyle}"
  353. Text="输送带数量:" />
  354. <TextBox
  355. Grid.Column="1"
  356. Width="170"
  357. Height="35"
  358. HorizontalAlignment="Right"
  359. FontSize="20"
  360. Style="{StaticResource TextBoxStyle}"
  361. Text="{Binding CommBaseParModel.ConveyerBeltCount, UpdateSourceTrigger=PropertyChanged}" />
  362. </Grid>
  363. </WrapPanel>
  364. <!--<Grid Grid.Row="2" Grid.ColumnSpan="4">
  365. <ListView
  366. Grid.Column="1"
  367. Background="Transparent"
  368. BorderBrush="#00BEFA"
  369. BorderThickness="0"
  370. ItemsSource="{Binding CommBaseParModel.ConveyerBeltModels}"
  371. ScrollViewer.HorizontalScrollBarVisibility="Disabled">
  372. <ListView.ItemsPanel>
  373. <ItemsPanelTemplate>
  374. <WrapPanel Orientation="Horizontal" />
  375. </ItemsPanelTemplate>
  376. </ListView.ItemsPanel>
  377. <ListView.ItemTemplate>
  378. <DataTemplate>
  379. <Grid
  380. Width="350"
  381. Margin="5"
  382. Background="Transparent">
  383. <Grid.ColumnDefinitions>
  384. <ColumnDefinition />
  385. <ColumnDefinition />
  386. </Grid.ColumnDefinitions>
  387. <StackPanel HorizontalAlignment="Right" Orientation="Horizontal">
  388. <TextBlock Style="{StaticResource TextBlockStyle}" Text="{Binding Name}" />
  389. <TextBlock
  390. Margin="0,0,2,0"
  391. Style="{StaticResource TextBlockStyle}"
  392. Text=":" />
  393. </StackPanel>
  394. <TextBox
  395. Grid.Column="1"
  396. Width="170"
  397. Height="35"
  398. HorizontalAlignment="Right"
  399. FontSize="20"
  400. Style="{StaticResource TextBoxStyle}"
  401. Text="{Binding Speed, UpdateSourceTrigger=PropertyChanged}" />
  402. </Grid>
  403. </DataTemplate>
  404. </ListView.ItemTemplate>
  405. </ListView>
  406. </Grid>-->
  407. </Grid>
  408. </UserControl>