终端一体化运控平台
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

320 lines
14 KiB

  1. <UserControl
  2. x:Class="BPASmartClient.DosingSystem.View.RecipeSettingsView"
  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.DosingSystem.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.DosingSystem.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="VerticalAlignment" Value="Center" />
  26. <Setter Property="HorizontalAlignment" Value="Center" />
  27. </Style>
  28. <Style x:Key="buttonStyle" TargetType="Button">
  29. <Setter Property="Background" Value="Transparent" />
  30. <Setter Property="FontSize" Value="16" />
  31. <Setter Property="Foreground" Value="Aqua" />
  32. <Setter Property="HorizontalAlignment" Value="Center" />
  33. <Setter Property="BorderThickness" Value="0" />
  34. </Style>
  35. <!--<Style x:Key="ListViewStyle" TargetType="ListView" />-->
  36. </UserControl.Resources>
  37. <UserControl.DataContext>
  38. <vm:RecipeSettingsViewModel />
  39. </UserControl.DataContext>
  40. <Grid>
  41. <Grid.RowDefinitions>
  42. <RowDefinition Height="50" />
  43. <RowDefinition Height="30" />
  44. <RowDefinition />
  45. </Grid.RowDefinitions>
  46. <!--#region 操作按钮-->
  47. <StackPanel HorizontalAlignment="Right" Orientation="Horizontal">
  48. <!--<pry:IcoButton
  49. Grid.Column="3"
  50. Width="140"
  51. Margin="10"
  52. HorizontalAlignment="Left"
  53. Command="{Binding NewMaterital}"
  54. Content="新建原料"
  55. FontSize="16"
  56. Foreground="Aqua"
  57. IcoText="&#xe626;"
  58. Style="{StaticResource IcoButtonStyle}" />-->
  59. <!--<Button
  60. Width="140"
  61. Height="30"
  62. Margin="10 0"
  63. Command="{Binding NewMaterital}"
  64. Content="新建原料"
  65. FontSize="16"
  66. Style="{StaticResource ImageButtonStyle}" />-->
  67. <Button
  68. Width="140"
  69. Height="30"
  70. Margin="10 0"
  71. Command="{Binding NewRecipe}"
  72. Content="新建配方"
  73. FontSize="16"
  74. Style="{StaticResource ImageButtonStyle}" />
  75. <Button
  76. Width="140"
  77. Height="30"
  78. Margin="10 0"
  79. Command="{Binding SaveRecipe}"
  80. Content="保存配方"
  81. FontSize="16"
  82. Style="{StaticResource ImageButtonStyle}" />
  83. <!--<pry:IcoButton
  84. Grid.Column="3"
  85. Width="140"
  86. Margin="10"
  87. HorizontalAlignment="Left"
  88. Command="{Binding NewRecipe}"
  89. Content="新建配方"
  90. FontSize="16"
  91. Foreground="Aqua"
  92. IcoText="&#xe626;"
  93. Style="{StaticResource IcoButtonStyle}" />-->
  94. <!--<pry:IcoButton
  95. Grid.Column="3"
  96. Width="140"
  97. Margin="10"
  98. HorizontalAlignment="Left"
  99. Command="{Binding SaveRecipe}"
  100. Content="保存配方"
  101. FontSize="17"
  102. Foreground="Aqua"
  103. IcoText="&#xe635;"
  104. IsEnabled="True"
  105. Style="{StaticResource IcoButtonStyle}" />-->
  106. </StackPanel>
  107. <!--#endregion-->
  108. <ListBox
  109. Grid.Row="2"
  110. Margin="5"
  111. VerticalAlignment="Top"
  112. Background="Transparent"
  113. BorderThickness="0"
  114. ItemsSource="{Binding Recipes}"
  115. ScrollViewer.HorizontalScrollBarVisibility="Disabled">
  116. <ListBox.ItemsPanel>
  117. <ItemsPanelTemplate>
  118. <!--<UniformGrid
  119. HorizontalAlignment="Left"
  120. VerticalAlignment="Top"
  121. Columns="8" />-->
  122. <WrapPanel Orientation="Horizontal" />
  123. </ItemsPanelTemplate>
  124. </ListBox.ItemsPanel>
  125. <ListBox.ItemTemplate>
  126. <DataTemplate>
  127. <Grid
  128. Name="tt"
  129. Width="180"
  130. Height="220"
  131. Margin="5">
  132. <Grid.RowDefinitions>
  133. <RowDefinition Height="30" />
  134. <RowDefinition Height="20" />
  135. <RowDefinition Height="128" />
  136. <RowDefinition Height="2" />
  137. <RowDefinition Height="40" />
  138. </Grid.RowDefinitions>
  139. <Image
  140. Grid.RowSpan="5"
  141. Source="/BPASmartClient.CustomResource;component/Image/配方背景/竖背景框.png"
  142. Stretch="Fill" />
  143. <TextBlock
  144. Grid.Row="0"
  145. Margin="2,5,0,0"
  146. HorizontalAlignment="Center"
  147. VerticalAlignment="Top"
  148. FontSize="18"
  149. Foreground="#FF2AB2E7"
  150. Text="{Binding RecipeName}" />
  151. <TextBlock
  152. Grid.Row="1"
  153. Margin="5,0,0,0"
  154. VerticalAlignment="Top"
  155. Foreground="#FF2AB2E7"
  156. Text="配方信息:" />
  157. <ScrollViewer
  158. Grid.Row="2"
  159. VerticalAlignment="Top"
  160. Background="Transparent"
  161. HorizontalScrollBarVisibility="Hidden"
  162. VerticalScrollBarVisibility="Hidden">
  163. <Grid>
  164. <Grid.ColumnDefinitions>
  165. <ColumnDefinition Width="auto" />
  166. <ColumnDefinition />
  167. </Grid.ColumnDefinitions>
  168. <ItemsControl ItemsSource="{Binding RawMaterials}">
  169. <ItemsControl.ItemTemplate>
  170. <DataTemplate>
  171. <Grid>
  172. <TextBlock
  173. Grid.Row="1"
  174. Margin="5,0,0,0"
  175. HorizontalAlignment="Right"
  176. VerticalAlignment="Center"
  177. Foreground="#aa2AB2E7"
  178. Text="{Binding RawMaterialName}" />
  179. </Grid>
  180. </DataTemplate>
  181. </ItemsControl.ItemTemplate>
  182. </ItemsControl>
  183. <ItemsControl Grid.Column="1" ItemsSource="{Binding RawMaterials}">
  184. <ItemsControl.ItemTemplate>
  185. <DataTemplate>
  186. <StackPanel Orientation="Horizontal">
  187. <TextBlock
  188. Margin="5,0,0,0"
  189. HorizontalAlignment="Center"
  190. VerticalAlignment="Center"
  191. Foreground="#aa2AB2E7"
  192. Text=":" />
  193. <TextBlock
  194. Margin="5,0,0,0"
  195. HorizontalAlignment="Center"
  196. VerticalAlignment="Center"
  197. Foreground="#aa2AB2E7"
  198. Text="{Binding RawMaterialWeight}" />
  199. <TextBlock
  200. Margin="5,0,0,0"
  201. HorizontalAlignment="Center"
  202. VerticalAlignment="Center"
  203. Foreground="#aa2AB2E7"
  204. Text="g" />
  205. </StackPanel>
  206. </DataTemplate>
  207. </ItemsControl.ItemTemplate>
  208. </ItemsControl>
  209. </Grid>
  210. </ScrollViewer>
  211. <!--<Grid
  212. Grid.Row="3"
  213. Height="2"
  214. VerticalAlignment="Bottom">
  215. <Grid.Background>
  216. <ImageBrush ImageSource="/BPASmartClient.CustomResource;component/Image/直线.png" Stretch="Fill" />
  217. </Grid.Background>
  218. </Grid>-->
  219. <Image
  220. Grid.Row="3"
  221. Width="{Binding ElementName=tt, Path=ActualWidth}"
  222. Height="2"
  223. VerticalAlignment="Bottom"
  224. Source="/BPASmartClient.CustomResource;component/Image/直线.png"
  225. Stretch="Fill" />
  226. <Grid
  227. Name="gr"
  228. Grid.Row="4"
  229. Height="30"
  230. Margin="0,0,0,10"
  231. VerticalAlignment="Bottom"
  232. Background="Transparent">
  233. <Grid.ColumnDefinitions>
  234. <ColumnDefinition />
  235. <ColumnDefinition />
  236. </Grid.ColumnDefinitions>
  237. <Image
  238. Grid.ColumnSpan="2"
  239. Width="{Binding ElementName=gr, Path=ActualWidth}"
  240. Height="2"
  241. VerticalAlignment="Top"
  242. Source="/BPASmartClient.CustomResource;component/Image/直线.png" />
  243. <pry:IcoButton
  244. Width="{Binding ElementName=gr, Path=ActualWidth}"
  245. Height="{Binding ElementName=gr, Path=ActualHeight}"
  246. Margin="4,4,3,0"
  247. HorizontalAlignment="Center"
  248. VerticalAlignment="Center"
  249. Background="#11F53F62"
  250. BorderThickness="0"
  251. Command="{Binding DataContext.RemoveCommand, RelativeSource={RelativeSource AncestorType=ListBox, Mode=FindAncestor}}"
  252. CommandParameter="{Binding RecipeName}"
  253. Content="删除"
  254. EnterBackground="#22F53F62"
  255. FontStyle="Normal"
  256. Foreground="#FFF53F62"
  257. IcoText="&#xe68e;"
  258. Style="{StaticResource IcoButtonStyle}" />
  259. <pry:IcoButton
  260. Grid.Column="1"
  261. Width="{Binding ElementName=gr, Path=ActualWidth}"
  262. Height="{Binding ElementName=gr, Path=ActualHeight}"
  263. Margin="3,4,4,0"
  264. HorizontalAlignment="Center"
  265. VerticalAlignment="Center"
  266. Background="#112AB2E7"
  267. BorderThickness="0"
  268. Command="{Binding DataContext.DetailsCommand, RelativeSource={RelativeSource AncestorType=ListBox, Mode=FindAncestor}}"
  269. CommandParameter="{Binding RecipeName}"
  270. Content="编辑"
  271. EnterBackground="#222AB2E7"
  272. Foreground="#FF2AB2E7"
  273. IcoText="&#xe636;"
  274. Style="{StaticResource IcoButtonStyle}" />
  275. </Grid>
  276. <!--</StackPanel>-->
  277. </Grid>
  278. </DataTemplate>
  279. </ListBox.ItemTemplate>
  280. </ListBox>
  281. </Grid>
  282. </UserControl>