终端一体化运控平台
Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.
 
 
 

387 rader
20 KiB

  1. <UserControl
  2. x:Class="BPASmartClient.JXJFoodBigStation.View.RecipeReceiveView"
  3. xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  4. xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  5. xmlns:control="clr-namespace:BPASmartClient.CustomResource.UserControls;assembly=BPASmartClient.CustomResource"
  6. xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
  7. xmlns:local="clr-namespace:BPASmartClient.JXJFoodBigStation.View"
  8. xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
  9. xmlns:pry="clr-namespace:BPASmartClient.CustomResource.UserControls;assembly=BPASmartClient.CustomResource"
  10. xmlns:vm="clr-namespace:BPASmartClient.JXJFoodBigStation.ViewModel"
  11. d:DesignHeight="450"
  12. d:DesignWidth="800"
  13. mc:Ignorable="d">
  14. <UserControl.Resources>
  15. <SolidColorBrush x:Key="BorderSolid" Color="#5523CACA" />
  16. <SolidColorBrush x:Key="FontColor" Color="#FF2AB2E7" />
  17. <SolidColorBrush x:Key="TitleFontColor" Color="#ddd" />
  18. <SolidColorBrush x:Key="CursorColor" Color="Aqua" />
  19. <SolidColorBrush x:Key="TitleBorderColor" Color="#FF2AB2E7" />
  20. <SolidColorBrush x:Key="TextBlockForeground" Color="#9934F7F7" />
  21. <Style x:Key="TextBlockStyle" TargetType="TextBlock">
  22. <Setter Property="FontFamily" Value="楷体" />
  23. <Setter Property="FontSize" Value="20" />
  24. <Setter Property="Background" Value="Transparent" />
  25. <!--<Setter Property="Foreground" Value="{StaticResource FontColor}" />-->
  26. <Setter Property="VerticalAlignment" Value="Center" />
  27. <Setter Property="HorizontalAlignment" Value="Center" />
  28. </Style>
  29. <Style x:Key="buttonStyle" TargetType="Button">
  30. <Setter Property="Background" Value="Transparent" />
  31. <Setter Property="FontSize" Value="16" />
  32. <Setter Property="Foreground" Value="Aqua" />
  33. <Setter Property="HorizontalAlignment" Value="Center" />
  34. <Setter Property="BorderThickness" Value="0" />
  35. </Style>
  36. <!--#region 下拉列表样式-->
  37. <Style x:Key="ToggleButtonStyle" TargetType="{x:Type ToggleButton}">
  38. <Setter Property="FocusVisualStyle" Value="{x:Null}" />
  39. <!--<Setter Property="Height" Value="10" />-->
  40. <Setter Property="HorizontalContentAlignment" Value="Left" />
  41. <Setter Property="VerticalContentAlignment" Value="Top" />
  42. <Setter Property="Padding" Value="10,10" />
  43. <Setter Property="Template">
  44. <Setter.Value>
  45. <ControlTemplate TargetType="{x:Type ToggleButton}">
  46. <Grid>
  47. <Border
  48. x:Name="border2"
  49. Width="auto"
  50. Margin="{TemplateBinding Padding}"
  51. HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
  52. VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
  53. Background="{TemplateBinding Background}">
  54. <ContentPresenter
  55. Margin="{TemplateBinding Padding}"
  56. HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
  57. VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
  58. RecognizesAccessKey="True"
  59. SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
  60. </Border>
  61. </Grid>
  62. <ControlTemplate.Triggers>
  63. <!--<Trigger Property="IsPressed" Value="true">
  64. <Setter Property="Background" Value="#FFd2e7f4" />
  65. </Trigger>
  66. <Trigger Property="IsChecked" Value="true">
  67. <Setter TargetName="border2" Property="Background" Value="#191E36" />
  68. </Trigger>
  69. <Trigger Property="IsChecked" Value="false">
  70. <Setter TargetName="border2" Property="Background" Value="#191E36" />
  71. </Trigger>-->
  72. <!--<Trigger Property="IsEnabled" Value="false">
  73. <Setter Property="Foreground" Value="White" />
  74. </Trigger>-->
  75. <Trigger Property="IsMouseOver" Value="True">
  76. <Setter TargetName="border2" Property="Background" Value="#191E36" />
  77. </Trigger>
  78. <Trigger Property="IsMouseOver" Value="False">
  79. <Setter TargetName="border2" Property="Background" Value="Transparent" />
  80. </Trigger>
  81. </ControlTemplate.Triggers>
  82. </ControlTemplate>
  83. </Setter.Value>
  84. </Setter>
  85. </Style>
  86. <Style x:Key="ExpanderStyle" TargetType="{x:Type Expander}">
  87. <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}" />
  88. <Setter Property="HorizontalContentAlignment" Value="Stretch" />
  89. <Setter Property="VerticalContentAlignment" Value="Stretch" />
  90. <Setter Property="BorderBrush" Value="Transparent" />
  91. <Setter Property="BorderThickness" Value="1" />
  92. <Setter Property="Template">
  93. <Setter.Value>
  94. <ControlTemplate TargetType="{x:Type Expander}">
  95. <DockPanel>
  96. <ToggleButton
  97. x:Name="HeaderSite"
  98. Height="20"
  99. Width="auto"
  100. MinWidth="0"
  101. MinHeight="0"
  102. Margin="1"
  103. Padding="{TemplateBinding Padding}"
  104. Background="Transparent"
  105. HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}"
  106. VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}"
  107. Content="{TemplateBinding Header}"
  108. ContentTemplate="{TemplateBinding HeaderTemplate}"
  109. ContentTemplateSelector="{TemplateBinding HeaderTemplateSelector}"
  110. DockPanel.Dock="Top"
  111. FontFamily="{TemplateBinding FontFamily}"
  112. FontSize="{TemplateBinding FontSize}"
  113. FontStretch="{TemplateBinding FontStretch}"
  114. FontStyle="{TemplateBinding FontStyle}"
  115. FontWeight="{TemplateBinding FontWeight}"
  116. Foreground="{TemplateBinding Foreground}"
  117. IsChecked="{Binding IsExpanded, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}"
  118. Style="{StaticResource ToggleButtonStyle}" />
  119. <ContentPresenter
  120. x:Name="ExpandSite"
  121. Margin="{TemplateBinding Padding}"
  122. HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
  123. VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
  124. DockPanel.Dock="Left"
  125. Focusable="false"
  126. Visibility="Visible" />
  127. </DockPanel>
  128. <ControlTemplate.Triggers>
  129. <Trigger Property="IsExpanded" Value="True">
  130. <Setter TargetName="ExpandSite" Property="Visibility" Value="Collapsed" />
  131. </Trigger>
  132. </ControlTemplate.Triggers>
  133. </ControlTemplate>
  134. </Setter.Value>
  135. </Setter>
  136. </Style>
  137. <!--#endregion-->
  138. </UserControl.Resources>
  139. <UserControl.DataContext>
  140. <vm:RecipeReceiveViewModel />
  141. </UserControl.DataContext>
  142. <Grid>
  143. <Grid.RowDefinitions>
  144. <RowDefinition Height="50"/>
  145. <RowDefinition />
  146. </Grid.RowDefinitions>
  147. <StackPanel HorizontalAlignment="Right" Orientation="Horizontal">
  148. <pry:IcoButton
  149. Width="140"
  150. Margin="10"
  151. HorizontalAlignment="Left"
  152. Command="{Binding NewRecipe}"
  153. Content="新建配方"
  154. FontSize="16"
  155. Foreground="Aqua"
  156. IcoText="&#xe626;"
  157. Style="{StaticResource IcoButtonStyle}" />
  158. <pry:IcoButton
  159. Width="140"
  160. Margin="10"
  161. HorizontalAlignment="Left"
  162. Command="{Binding NewSimulateRecipe}"
  163. Content="新建模拟配方"
  164. FontSize="16"
  165. Foreground="Aqua"
  166. IcoText="&#xe626;"
  167. Style="{StaticResource IcoButtonStyle}" />
  168. <pry:IcoButton
  169. Grid.Column="3"
  170. Width="140"
  171. Margin="10"
  172. HorizontalAlignment="Left"
  173. Command="{Binding ClearAllRecipe}"
  174. Content="清除所有配方"
  175. FontSize="16"
  176. Foreground="Aqua"
  177. IcoText="&#xe635;"
  178. IsEnabled="True"
  179. Style="{StaticResource IcoButtonStyle}" />
  180. </StackPanel>
  181. <ScrollViewer Grid.Row="1">
  182. <ListBox
  183. Grid.Row="2"
  184. Margin="5"
  185. VerticalAlignment="Top"
  186. Background="Transparent"
  187. BorderThickness="0"
  188. ItemsSource="{Binding Recipes}"
  189. ScrollViewer.HorizontalScrollBarVisibility="Disabled">
  190. <ListBox.ItemsPanel>
  191. <ItemsPanelTemplate>
  192. <UniformGrid
  193. HorizontalAlignment="Left"
  194. VerticalAlignment="Top"
  195. Columns="8" />
  196. </ItemsPanelTemplate>
  197. </ListBox.ItemsPanel>
  198. <ListBox.ItemTemplate>
  199. <DataTemplate>
  200. <Grid
  201. Name="tt"
  202. Height="220"
  203. Margin="5">
  204. <Grid.RowDefinitions>
  205. <RowDefinition Height="30" />
  206. <RowDefinition Height="20" />
  207. <RowDefinition Height="128" />
  208. <RowDefinition Height="2" />
  209. <RowDefinition Height="40" />
  210. </Grid.RowDefinitions>
  211. <Image
  212. Grid.RowSpan="5"
  213. Source="/BPASmartClient.CustomResource;component/Image/配方背景/竖背景框.png"
  214. Stretch="Fill" />
  215. <TextBlock
  216. Grid.Row="0"
  217. Margin="2,5,0,0"
  218. HorizontalAlignment="Center"
  219. VerticalAlignment="Top"
  220. FontSize="18"
  221. Foreground="#FF2AB2E7"
  222. Text="{Binding RecipeName}" />
  223. <TextBlock
  224. Grid.Row="1"
  225. Margin="5,0,0,0"
  226. VerticalAlignment="Top"
  227. Foreground="#FF2AB2E7"
  228. Text="配方信息:" />
  229. <ScrollViewer
  230. Grid.Row="2"
  231. VerticalAlignment="Top"
  232. Background="Transparent"
  233. HorizontalScrollBarVisibility="Hidden"
  234. VerticalScrollBarVisibility="Hidden">
  235. <ItemsControl ItemsSource="{Binding RawMaterial}">
  236. <ItemsControl.ItemsPanel>
  237. <ItemsPanelTemplate>
  238. <StackPanel/>
  239. </ItemsPanelTemplate>
  240. </ItemsControl.ItemsPanel>
  241. <ItemsControl.ItemTemplate>
  242. <DataTemplate>
  243. <Expander Style="{StaticResource ExpanderStyle}" Margin="40,0,0,0">
  244. <Expander.Header>
  245. <StackPanel Orientation="Horizontal">
  246. <Border Width="15" Height="15" CornerRadius="15" HorizontalAlignment="Left" Margin="0,0,5,0">
  247. <Border.Background>
  248. <RadialGradientBrush>
  249. <GradientStop Color="#FF2AB2E7" Offset="0.5" />
  250. <GradientStop Color="White"/>
  251. </RadialGradientBrush>
  252. </Border.Background>
  253. </Border>
  254. <TextBlock Text="{Binding RawMaterialLocation }" Foreground="#FF2AB2E7" VerticalAlignment="Center"/>
  255. </StackPanel>
  256. </Expander.Header>
  257. <Expander.Content>
  258. <StackPanel Margin="36,0,0,0">
  259. <StackPanel Orientation="Horizontal">
  260. <TextBlock Text="托盘编号:" Foreground="#FF2AB2E7"/>
  261. <TextBlock Text="{Binding RawMaterialBarrelNum}" Foreground="#FF2AB2E7"/>
  262. </StackPanel>
  263. <StackPanel Orientation="Horizontal">
  264. <TextBlock Text="原料重量:" Foreground="#FF2AB2E7"/>
  265. <TextBlock Text="{Binding RawMaterialWeight}" Foreground="#FF2AB2E7"/>
  266. </StackPanel>
  267. </StackPanel>
  268. </Expander.Content>
  269. </Expander>
  270. </DataTemplate>
  271. </ItemsControl.ItemTemplate>
  272. </ItemsControl>
  273. </ScrollViewer>
  274. <Image
  275. Grid.Row="3"
  276. Width="{Binding ElementName=tt, Path=ActualWidth}"
  277. Height="2"
  278. VerticalAlignment="Bottom"
  279. Source="/BPASmartClient.CustomResource;component/Image/直线.png"
  280. Stretch="Fill" />
  281. <Grid
  282. Name="gr"
  283. Grid.Row="4"
  284. Height="30"
  285. Margin="0,0,0,10"
  286. VerticalAlignment="Bottom"
  287. Background="Transparent">
  288. <Grid.ColumnDefinitions>
  289. <ColumnDefinition />
  290. <ColumnDefinition />
  291. </Grid.ColumnDefinitions>
  292. <!--<Image
  293. Height="2"
  294. Grid.ColumnSpan="2"
  295. Width="{Binding ElementName=gr, Path=ActualWidth}"
  296. VerticalAlignment="Top"
  297. Source="/BPASmartClient.CustomResource;component/Image/直线.png" />-->
  298. <!--<pry:IcoButton
  299. Grid.Column="1"
  300. Width="{Binding ElementName=gr, Path=ActualWidth}"
  301. Height="{Binding ElementName=gr, Path=ActualHeight}"
  302. Margin="4,4,4,0"
  303. HorizontalAlignment="Center"
  304. VerticalAlignment="Center"
  305. Background="#11F53F62"
  306. BorderThickness="0"
  307. Command="{Binding DataContext.RemoveCommand, RelativeSource={RelativeSource AncestorType=ListBox, Mode=FindAncestor}}"
  308. CommandParameter="{Binding RecipCode}"
  309. Content="删除"
  310. EnterBackground="#22F53F62"
  311. FontStyle="Normal"
  312. Foreground="#FFF53F62"
  313. IcoText="&#xe68e;"
  314. Style="{StaticResource IcoButtonStyle}" />-->
  315. <pry:IcoButton
  316. Grid.Column="1"
  317. Width="{Binding ElementName=gr, Path=ActualWidth}"
  318. Height="{Binding ElementName=gr, Path=ActualHeight}"
  319. Margin="3,4,4,0"
  320. HorizontalAlignment="Center"
  321. VerticalAlignment="Center"
  322. Background="#11F53F62"
  323. BorderThickness="0"
  324. Command="{Binding DataContext.RemoveCommand, RelativeSource={RelativeSource AncestorType=ListBox, Mode=FindAncestor}}"
  325. CommandParameter="{Binding RecipeCode}"
  326. Content="删除"
  327. EnterBackground="#22F53F62"
  328. Foreground="#FFF53F62"
  329. IcoText="&#xe68e;"
  330. Style="{StaticResource IcoButtonStyle}" />
  331. <pry:IcoButton
  332. Width="{Binding ElementName=gr, Path=ActualWidth}"
  333. Height="{Binding ElementName=gr, Path=ActualHeight}"
  334. Margin="3,4,4,0"
  335. HorizontalAlignment="Center"
  336. VerticalAlignment="Center"
  337. Background="#112AB2E7"
  338. BorderThickness="0"
  339. Command="{Binding DataContext.DetailsCommand, RelativeSource={RelativeSource AncestorType=ListBox, Mode=FindAncestor}}"
  340. CommandParameter="{Binding RecipeCode}"
  341. Content="编辑"
  342. EnterBackground="#222AB2E7"
  343. Foreground="#FF2AB2E7"
  344. IcoText="&#xe636;"
  345. Style="{StaticResource IcoButtonStyle}" />
  346. </Grid>
  347. </Grid>
  348. </DataTemplate>
  349. </ListBox.ItemTemplate>
  350. </ListBox>
  351. </ScrollViewer>
  352. </Grid>
  353. </UserControl>