终端一体化运控平台
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.
 
 
 

297 lines
16 KiB

  1. <Window
  2. x:Class="BPASmartClient.MorkCL.View.EditRecipeView"
  3. xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  4. xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  5. xmlns:Behaviors="http://schemas.microsoft.com/xaml/behaviors"
  6. xmlns:converter="clr-namespace:BPASmartClient.MorkCL.Converter"
  7. xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
  8. xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
  9. xmlns:vm="clr-namespace:BPASmartClient.MorkCL.ViewModel"
  10. Title="EditRecipeView"
  11. Width="900"
  12. Height="700"
  13. AllowsTransparency="True"
  14. Background="{x:Null}"
  15. Topmost="True"
  16. WindowStartupLocation="CenterScreen"
  17. WindowStyle="None"
  18. mc:Ignorable="d">
  19. <Window.DataContext>
  20. <vm:EditRecipeViewModel />
  21. </Window.DataContext>
  22. <Window.Resources>
  23. <ResourceDictionary>
  24. <ResourceDictionary.MergedDictionaries>
  25. <ResourceDictionary Source="/BPASmartClient.MorkCL;component/CustomStyle/CustomStyle.xaml" />
  26. </ResourceDictionary.MergedDictionaries>
  27. <converter:IndexConverter x:Key="indexConvert" />
  28. </ResourceDictionary>
  29. </Window.Resources>
  30. <Border
  31. Name="br"
  32. BorderBrush="#0CADF5"
  33. BorderThickness="0">
  34. <Border.Background>
  35. <ImageBrush ImageSource="/BPASmartClient.CustomResource;component/Image/弹框/z4.png" />
  36. </Border.Background>
  37. <Grid>
  38. <Grid.RowDefinitions>
  39. <RowDefinition Height="50" />
  40. <RowDefinition Height="50" />
  41. <RowDefinition Height="1*" />
  42. </Grid.RowDefinitions>
  43. <!--#region 标题栏-->
  44. <TextBlock
  45. HorizontalAlignment="Center"
  46. VerticalAlignment="Center"
  47. Foreground="DeepSkyBlue"
  48. Text="配方编辑界面" />
  49. <!--#endregion-->
  50. <!--#region 操作栏-->
  51. <Border
  52. Grid.Row="1"
  53. BorderBrush="#3099E5"
  54. BorderThickness="1">
  55. <DockPanel LastChildFill="False">
  56. <TextBlock
  57. Margin="5,0"
  58. DockPanel.Dock="Left"
  59. Text="配方名称:" />
  60. <TextBox
  61. Width="150"
  62. Height="35"
  63. DockPanel.Dock="Left"
  64. FontSize="18"
  65. Foreground="DeepSkyBlue"
  66. Text="{Binding Name}" />
  67. <!-- 只有炒菜,没有炖菜 -->
  68. <!--<TextBlock
  69. Margin="10,0"
  70. DockPanel.Dock="Left"
  71. Text="菜品类型:" />
  72. <ComboBox
  73. Width="150"
  74. Height="35"
  75. FontSize="18"
  76. IsReadOnly="True"
  77. ItemsSource="{Binding AllDishType}"
  78. Text="{Binding DishType}" />-->
  79. <Button
  80. Margin="10,0"
  81. Click="Button_Click"
  82. Content="取消并关闭"
  83. DockPanel.Dock="Right" />
  84. <Button
  85. Margin="10,0"
  86. Command="{Binding SaveParamCommand}"
  87. Content="保存参数"
  88. DockPanel.Dock="Right" />
  89. <Button
  90. Margin="10,0"
  91. Command="{Binding AddFuncCommand}"
  92. Content="添加功能"
  93. DockPanel.Dock="Right" />
  94. </DockPanel>
  95. </Border>
  96. <!--#endregion-->
  97. <!--#region 数据栏-->
  98. <Grid Grid.Row="2" Margin="5">
  99. <Grid.RowDefinitions>
  100. <RowDefinition Height="40" />
  101. <RowDefinition Height="1*" />
  102. </Grid.RowDefinitions>
  103. <!--#region 表格标题栏设置-->
  104. <Grid Margin="0,10,17,0" Background="#ff0C255F">
  105. <Grid.ColumnDefinitions>
  106. <ColumnDefinition Width="50" />
  107. <ColumnDefinition Width="230" />
  108. <ColumnDefinition />
  109. <ColumnDefinition />
  110. <ColumnDefinition />
  111. <ColumnDefinition />
  112. </Grid.ColumnDefinitions>
  113. <Grid Grid.Column="0">
  114. <TextBlock Style="{StaticResource TitleTextblockStyle}" Text="步骤" />
  115. <Border
  116. BorderBrush="{StaticResource bordColor}"
  117. BorderThickness="1,0,1,0"
  118. Cursor="SizeWE" />
  119. </Grid>
  120. <TextBlock
  121. Grid.Column="1"
  122. Style="{StaticResource TitleTextblockStyle}"
  123. Text="功能选择" />
  124. <Grid Grid.Column="2">
  125. <TextBlock Style="{StaticResource TitleTextblockStyle}" Text="编辑" />
  126. <Border
  127. BorderBrush="{StaticResource bordColor}"
  128. BorderThickness="1,0,1,0"
  129. Cursor="SizeWE" />
  130. </Grid>
  131. <Grid Grid.Column="3">
  132. <TextBlock Style="{StaticResource TitleTextblockStyle}" Text="上移" />
  133. <Border
  134. BorderBrush="{StaticResource bordColor}"
  135. BorderThickness="1,0,1,0"
  136. Cursor="SizeWE" />
  137. </Grid>
  138. <Grid Grid.Column="4">
  139. <TextBlock Style="{StaticResource TitleTextblockStyle}" Text="下移" />
  140. <Border
  141. BorderBrush="{StaticResource bordColor}"
  142. BorderThickness="1,0,1,0"
  143. Cursor="SizeWE" />
  144. </Grid>
  145. <Grid Grid.Column="5">
  146. <TextBlock Style="{StaticResource TitleTextblockStyle}" Text="编辑" />
  147. <Border
  148. BorderBrush="{StaticResource bordColor}"
  149. BorderThickness="1,0,1,0"
  150. Cursor="SizeWE" />
  151. </Grid>
  152. <Border
  153. Grid.ColumnSpan="10"
  154. BorderBrush="{StaticResource bordColor}"
  155. BorderThickness="1,0,1,0" />
  156. </Grid>
  157. <!--#endregion-->
  158. <!--#region 表格数据-->
  159. <Grid Grid.Row="1">
  160. <ScrollViewer HorizontalScrollBarVisibility="Hidden" VerticalScrollBarVisibility="Visible">
  161. <ItemsControl
  162. x:Name="contentControl"
  163. AlternationCount="{Binding Functions.Count}"
  164. ItemsSource="{Binding Functions}">
  165. <ItemsControl.ItemTemplate>
  166. <DataTemplate>
  167. <Grid
  168. Name="gr"
  169. Height="40"
  170. Margin="0,5">
  171. <Grid.ColumnDefinitions>
  172. <ColumnDefinition Width="50" />
  173. <ColumnDefinition Width="230" />
  174. <ColumnDefinition />
  175. <ColumnDefinition />
  176. <ColumnDefinition />
  177. <ColumnDefinition />
  178. </Grid.ColumnDefinitions>
  179. <Grid>
  180. <TextBlock
  181. Grid.Column="0"
  182. HorizontalAlignment="Center"
  183. Style="{StaticResource LeftAligentTextStyle}"
  184. Text="{Binding Path=(ItemsControl.AlternationIndex), RelativeSource={RelativeSource TemplatedParent}, Converter={StaticResource indexConvert}}"
  185. TextAlignment="Right" />
  186. <Border
  187. BorderBrush="{StaticResource bordColor}"
  188. BorderThickness="2,0,2,0"
  189. Cursor="SizeWE" />
  190. </Grid>
  191. <Grid Grid.Column="1">
  192. <ComboBox
  193. Height="40"
  194. FontSize="18"
  195. IsReadOnly="True"
  196. ItemsSource="{Binding DataContext.AllFunc, RelativeSource={RelativeSource AncestorType=ItemsControl, Mode=FindAncestor}}"
  197. Text="{Binding eFunc}">
  198. <Behaviors:Interaction.Triggers>
  199. <Behaviors:EventTrigger EventName="DropDownClosed">
  200. <Behaviors:InvokeCommandAction Command="{Binding DataContext.FuncChangeCommand, ElementName=contentControl}" CommandParameter="{Binding}" />
  201. </Behaviors:EventTrigger>
  202. <Behaviors:EventTrigger EventName="DropDownOpened">
  203. <Behaviors:InvokeCommandAction Command="{Binding DataContext.DropDownOenCommand, ElementName=contentControl}" CommandParameter="{Binding eFunc}" />
  204. </Behaviors:EventTrigger>
  205. <!--<Behaviors:EventTrigger EventName="PreviewMouseLeftButtonDown">
  206. <Behaviors:ChangePropertyAction PropertyName="IsDropDownOpen" Value="True"/>
  207. </Behaviors:EventTrigger>-->
  208. </Behaviors:Interaction.Triggers>
  209. </ComboBox>
  210. <Border
  211. BorderBrush="{StaticResource bordColor}"
  212. BorderThickness="2,0,2,0"
  213. Cursor="SizeWE" />
  214. </Grid>
  215. <Grid Grid.Column="2">
  216. <Button
  217. Command="{Binding DataContext.EditCommand, RelativeSource={RelativeSource AncestorType=ItemsControl, Mode=FindAncestor}}"
  218. CommandParameter="{Binding}"
  219. Content="编辑"
  220. FontSize="16"
  221. Style="{StaticResource IssueRecipeButtonStyle}" />
  222. <Border
  223. BorderBrush="{StaticResource bordColor}"
  224. BorderThickness="2,0,2,0"
  225. Cursor="SizeWE" />
  226. </Grid>
  227. <Grid Grid.Column="3">
  228. <Button
  229. Command="{Binding DataContext.MoveUpCommand, RelativeSource={RelativeSource AncestorType=ItemsControl, Mode=FindAncestor}}"
  230. CommandParameter="{Binding}"
  231. Content="上移"
  232. FontSize="16"
  233. Style="{StaticResource IssueRecipeButtonStyle}" />
  234. <Border
  235. BorderBrush="{StaticResource bordColor}"
  236. BorderThickness="2,0,2,0"
  237. Cursor="SizeWE" />
  238. </Grid>
  239. <Grid Grid.Column="4">
  240. <Button
  241. Command="{Binding DataContext.MoveDownCommand, RelativeSource={RelativeSource AncestorType=ItemsControl, Mode=FindAncestor}}"
  242. CommandParameter="{Binding}"
  243. Content="下移"
  244. FontSize="16"
  245. Style="{StaticResource IssueRecipeButtonStyle}" />
  246. <Border
  247. BorderBrush="{StaticResource bordColor}"
  248. BorderThickness="2,0,2,0"
  249. Cursor="SizeWE" />
  250. </Grid>
  251. <Grid Grid.Column="5">
  252. <Button
  253. Command="{Binding DataContext.RemoveCommand, RelativeSource={RelativeSource AncestorType=ItemsControl, Mode=FindAncestor}}"
  254. CommandParameter="{Binding}"
  255. Content="删除"
  256. FontSize="16"
  257. Style="{StaticResource ControlButtonStyle}" />
  258. <Border
  259. BorderBrush="{StaticResource bordColor}"
  260. BorderThickness="1,0,1,0"
  261. Cursor="SizeWE" />
  262. </Grid>
  263. <Border
  264. Grid.ColumnSpan="10"
  265. BorderBrush="{StaticResource bordColor}"
  266. BorderThickness="1,0,1,1" />
  267. </Grid>
  268. <DataTemplate.Triggers>
  269. <Trigger Property="IsMouseOver" Value="true">
  270. <Setter TargetName="gr" Property="Background" Value="#112AB2E7" />
  271. </Trigger>
  272. </DataTemplate.Triggers>
  273. </DataTemplate>
  274. </ItemsControl.ItemTemplate>
  275. </ItemsControl>
  276. </ScrollViewer>
  277. </Grid>
  278. <!--#endregion-->
  279. </Grid>
  280. <!--#endregion-->
  281. </Grid>
  282. </Border>
  283. </Window>