终端一体化运控平台
選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。
 
 
 

274 行
14 KiB

  1. <UserControl
  2. x:Class="BPASmartClient.MorkCL.View.RecipeManageView"
  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.MorkCL.View"
  7. xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
  8. xmlns:pry="clr-namespace:BPASmartClient.CustomResource.UserControls;assembly=BPASmartClient.CustomResource"
  9. xmlns:vm="clr-namespace:BPASmartClient.MorkCL.ViewModel"
  10. Name="配方管理"
  11. mc:Ignorable="d">
  12. <UserControl.DataContext>
  13. <vm:RecipeManageViewModel />
  14. </UserControl.DataContext>
  15. <UserControl.Resources>
  16. <ResourceDictionary>
  17. <ResourceDictionary.MergedDictionaries>
  18. <ResourceDictionary Source="/BPASmartClient.CustomResource;component/Themes/GenricStyle.xaml" />
  19. <ResourceDictionary Source="/BPASmartClient.CustomResource;component/Themes/MyStyle.xaml" />
  20. <ResourceDictionary Source="/BPASmartClient.CustomResource;component/Recdictionarys/GlobalStyle.xaml" />
  21. </ResourceDictionary.MergedDictionaries>
  22. <Style x:Key="DataShowTextBoxStyle" TargetType="TextBox">
  23. <Setter Property="Margin" Value="5,0,0,0" />
  24. <Setter Property="BorderThickness" Value="0" />
  25. <Setter Property="HorizontalAlignment" Value="Center" />
  26. <Setter Property="Height" Value="50" />
  27. <Setter Property="CaretBrush" Value="{StaticResource TitleBorderColor}" />
  28. <Setter Property="Foreground" Value="{StaticResource TitleBorderColor}" />
  29. <Setter Property="VerticalContentAlignment" Value="Center" />
  30. <Setter Property="FontSize" Value="14" />
  31. <Setter Property="Background" Value="Transparent" />
  32. <Setter Property="VerticalAlignment" Value="Center" />
  33. </Style>
  34. <Style
  35. x:Key="IssueRecipeButtonStyle"
  36. BasedOn="{StaticResource ControlButtonStyle}"
  37. TargetType="Button">
  38. <Setter Property="Foreground" Value="{StaticResource FontColor}" />
  39. <Setter Property="Template">
  40. <Setter.Value>
  41. <ControlTemplate TargetType="Button">
  42. <Border
  43. Name="TitleBarBr"
  44. BorderBrush="#00c2f4"
  45. BorderThickness="0"
  46. CornerRadius="0"
  47. Opacity="0.8">
  48. <ContentPresenter
  49. Margin="{TemplateBinding Margin}"
  50. HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
  51. VerticalAlignment="{TemplateBinding VerticalContentAlignment}" />
  52. <Border.Background>
  53. <ImageBrush
  54. ImageSource="/BPASmartClient.CustomResource;component/Image/组合边框2.1.png"
  55. Opacity="0.8"
  56. Stretch="Fill" />
  57. </Border.Background>
  58. </Border>
  59. <ControlTemplate.Triggers>
  60. <Trigger Property="IsMouseOver" Value="true">
  61. <Setter TargetName="TitleBarBr" Property="Opacity" Value="1" />
  62. </Trigger>
  63. </ControlTemplate.Triggers>
  64. </ControlTemplate>
  65. </Setter.Value>
  66. </Setter>
  67. </Style>
  68. </ResourceDictionary>
  69. </UserControl.Resources>
  70. <Grid>
  71. <Grid.RowDefinitions>
  72. <RowDefinition Height="40" />
  73. <RowDefinition Height="1*" />
  74. </Grid.RowDefinitions>
  75. <!--#region 标题栏设置-->
  76. <pry:ImageBorder Grid.Row="0">
  77. <StackPanel
  78. Height="40"
  79. Margin="5,0"
  80. FlowDirection="RightToLeft"
  81. Orientation="Horizontal">
  82. <Button
  83. Margin="0,0,50,0"
  84. VerticalAlignment="Center"
  85. Command="{Binding ClearAllRecipeCommand}"
  86. Content="清除所有配方" />
  87. <Button
  88. Margin="5,0"
  89. VerticalAlignment="Center"
  90. Command="{Binding AddRecipeCommand}"
  91. Content="添加配方" />
  92. <!--<Button
  93. Margin="5,0"
  94. VerticalAlignment="Center"
  95. Command="{Binding SaveParamCommand}"
  96. Content="保存所有配方" />-->
  97. </StackPanel>
  98. </pry:ImageBorder>
  99. <!--#endregion-->
  100. <!--#region 配方管理正文-->
  101. <pry:ImageBorder Grid.Row="1" Margin="5">
  102. <Grid>
  103. <Grid.RowDefinitions>
  104. <RowDefinition Height="40" />
  105. <RowDefinition Height="1*" />
  106. </Grid.RowDefinitions>
  107. <!--#region 标题栏设置-->
  108. <Grid Margin="0,10,17,0" Background="#ff0C255F">
  109. <Grid.ColumnDefinitions>
  110. <ColumnDefinition Width="200" />
  111. <ColumnDefinition Width="100" />
  112. <ColumnDefinition />
  113. <ColumnDefinition Width="200" />
  114. <ColumnDefinition Width="200" />
  115. <ColumnDefinition Width="100" />
  116. </Grid.ColumnDefinitions>
  117. <TextBlock
  118. Grid.Column="0"
  119. Style="{StaticResource TitleTextblockStyle}"
  120. Text="名称" />
  121. <Grid Grid.Column="1">
  122. <TextBlock Style="{StaticResource TitleTextblockStyle}" Text="菜品类型" />
  123. <Border
  124. BorderBrush="{StaticResource bordColor}"
  125. BorderThickness="1,0,1,0"
  126. Cursor="SizeWE" />
  127. </Grid>
  128. <Grid Grid.Column="2">
  129. <TextBlock Style="{StaticResource TitleTextblockStyle}" Text="备注" />
  130. <Border
  131. BorderBrush="{StaticResource bordColor}"
  132. BorderThickness="1,0,1,0"
  133. Cursor="SizeWE" />
  134. </Grid>
  135. <TextBlock
  136. Grid.Column="3"
  137. Style="{StaticResource TitleTextblockStyle}"
  138. Text="下发" />
  139. <Grid Grid.Column="4">
  140. <TextBlock Style="{StaticResource TitleTextblockStyle}" Text="编辑" />
  141. <Border
  142. BorderBrush="{StaticResource bordColor}"
  143. BorderThickness="1,0,1,0"
  144. Cursor="SizeWE" />
  145. </Grid>
  146. <Grid Grid.Column="5">
  147. <TextBlock Style="{StaticResource TitleTextblockStyle}" Text="删除" />
  148. <Border
  149. BorderBrush="{StaticResource bordColor}"
  150. BorderThickness="1,0,1,0"
  151. Cursor="SizeWE" />
  152. </Grid>
  153. <Border
  154. Grid.ColumnSpan="10"
  155. BorderBrush="{StaticResource bordColor}"
  156. BorderThickness="1,0,1,0" />
  157. </Grid>
  158. <!--#endregion-->
  159. <!--#region 表格数据显示设置-->
  160. <Grid Grid.Row="1">
  161. <ScrollViewer HorizontalScrollBarVisibility="Hidden" VerticalScrollBarVisibility="Visible">
  162. <ItemsControl ItemsSource="{Binding Recipes}">
  163. <ItemsControl.ItemTemplate>
  164. <DataTemplate>
  165. <Grid>
  166. <Grid.ColumnDefinitions>
  167. <ColumnDefinition Width="200" />
  168. <ColumnDefinition Width="100" />
  169. <ColumnDefinition />
  170. <ColumnDefinition Width="200" />
  171. <ColumnDefinition Width="200" />
  172. <ColumnDefinition Width="100" />
  173. </Grid.ColumnDefinitions>
  174. <TextBlock
  175. Grid.Column="0"
  176. HorizontalAlignment="Center"
  177. Style="{StaticResource TextBlockStyle}"
  178. Text="{Binding Name}"
  179. TextAlignment="Center" />
  180. <Grid Grid.Column="1">
  181. <TextBox
  182. MinWidth="400"
  183. Style="{StaticResource DataShowTextBoxStyle}"
  184. Text="{Binding DishType}"
  185. TextAlignment="Center" />
  186. <Border
  187. BorderBrush="{StaticResource bordColor}"
  188. BorderThickness="1,0,1,0"
  189. Cursor="SizeWE" />
  190. </Grid>
  191. <Grid Grid.Column="2">
  192. <TextBox
  193. MinWidth="400"
  194. Style="{StaticResource DataShowTextBoxStyle}"
  195. Text="{Binding Remark}"
  196. TextAlignment="Center" />
  197. <Border
  198. BorderBrush="{StaticResource bordColor}"
  199. BorderThickness="1,0,1,0"
  200. Cursor="SizeWE" />
  201. </Grid>
  202. <Grid Grid.Column="3" Margin="5">
  203. <Button
  204. Command="{Binding DataContext.IssueCommand, RelativeSource={RelativeSource AncestorType=ItemsControl, Mode=FindAncestor}}"
  205. CommandParameter="{Binding}"
  206. Content="下发"
  207. FontSize="16"
  208. Style="{StaticResource IssueRecipeButtonStyle}" />
  209. <Border
  210. BorderBrush="{StaticResource bordColor}"
  211. BorderThickness="1,0,1,0"
  212. Cursor="SizeWE" />
  213. </Grid>
  214. <Grid Grid.Column="4" Margin="5">
  215. <Button
  216. Command="{Binding DataContext.EditCommand, RelativeSource={RelativeSource AncestorType=ItemsControl, Mode=FindAncestor}}"
  217. CommandParameter="{Binding}"
  218. Content="编辑"
  219. FontSize="16"
  220. Style="{StaticResource IssueRecipeButtonStyle}" />
  221. <Border
  222. BorderBrush="{StaticResource bordColor}"
  223. BorderThickness="1,0,1,0"
  224. Cursor="SizeWE" />
  225. </Grid>
  226. <Grid Grid.Column="5">
  227. <Button
  228. Command="{Binding DataContext.RemoveCommand, RelativeSource={RelativeSource AncestorType=ItemsControl, Mode=FindAncestor}}"
  229. CommandParameter="{Binding Id}"
  230. Content="删除"
  231. FontSize="16"
  232. Style="{StaticResource ControlButtonStyle}" />
  233. <Border
  234. BorderBrush="{StaticResource bordColor}"
  235. BorderThickness="1,0,1,0"
  236. Cursor="SizeWE" />
  237. </Grid>
  238. <Border
  239. Grid.ColumnSpan="10"
  240. BorderBrush="{StaticResource bordColor}"
  241. BorderThickness="1,0,1,1" />
  242. </Grid>
  243. </DataTemplate>
  244. </ItemsControl.ItemTemplate>
  245. </ItemsControl>
  246. </ScrollViewer>
  247. </Grid>
  248. <!--#endregion-->
  249. </Grid>
  250. </pry:ImageBorder>
  251. <!--#endregion-->
  252. </Grid>
  253. </UserControl>