终端一体化运控平台
Ви не можете вибрати більше 25 тем Теми мають розпочинатися з літери або цифри, можуть містити дефіси (-) і не повинні перевищувати 35 символів.
 
 
 

290 рядки
13 KiB

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