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

287 строки
15 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 Name="gr" Height="30">
  168. <Grid.ColumnDefinitions>
  169. <ColumnDefinition Width="50" />
  170. <ColumnDefinition Width="230" />
  171. <ColumnDefinition />
  172. <ColumnDefinition />
  173. <ColumnDefinition />
  174. <ColumnDefinition />
  175. </Grid.ColumnDefinitions>
  176. <Grid>
  177. <TextBlock
  178. Grid.Column="0"
  179. HorizontalAlignment="Center"
  180. Style="{StaticResource LeftAligentTextStyle}"
  181. Text="{Binding Path=(ItemsControl.AlternationIndex), RelativeSource={RelativeSource TemplatedParent}, Converter={StaticResource indexConvert}}"
  182. TextAlignment="Right" />
  183. <Border
  184. BorderBrush="{StaticResource bordColor}"
  185. BorderThickness="2,0,2,0"
  186. Cursor="SizeWE" />
  187. </Grid>
  188. <Grid Grid.Column="1">
  189. <ComboBox
  190. Height="30"
  191. FontSize="18"
  192. IsReadOnly="True"
  193. ItemsSource="{Binding DataContext.AllFunc, RelativeSource={RelativeSource AncestorType=ItemsControl, Mode=FindAncestor}}"
  194. Text="{Binding eFunc}">
  195. <Behaviors:Interaction.Triggers>
  196. <Behaviors:EventTrigger EventName="DropDownClosed">
  197. <Behaviors:InvokeCommandAction Command="{Binding DataContext.FuncChangeCommand, ElementName=contentControl}" CommandParameter="{Binding}" />
  198. </Behaviors:EventTrigger>
  199. </Behaviors:Interaction.Triggers>
  200. </ComboBox>
  201. <Border
  202. BorderBrush="{StaticResource bordColor}"
  203. BorderThickness="2,0,2,0"
  204. Cursor="SizeWE" />
  205. </Grid>
  206. <Grid Grid.Column="2">
  207. <Button
  208. Command="{Binding DataContext.EditCommand, RelativeSource={RelativeSource AncestorType=ItemsControl, Mode=FindAncestor}}"
  209. CommandParameter="{Binding}"
  210. Content="编辑"
  211. FontSize="16"
  212. Style="{StaticResource IssueRecipeButtonStyle}" />
  213. <Border
  214. BorderBrush="{StaticResource bordColor}"
  215. BorderThickness="2,0,2,0"
  216. Cursor="SizeWE" />
  217. </Grid>
  218. <Grid Grid.Column="3">
  219. <Button
  220. Command="{Binding DataContext.MoveUpCommand, RelativeSource={RelativeSource AncestorType=ItemsControl, Mode=FindAncestor}}"
  221. CommandParameter="{Binding}"
  222. Content="上移"
  223. FontSize="16"
  224. Style="{StaticResource IssueRecipeButtonStyle}" />
  225. <Border
  226. BorderBrush="{StaticResource bordColor}"
  227. BorderThickness="2,0,2,0"
  228. Cursor="SizeWE" />
  229. </Grid>
  230. <Grid Grid.Column="4">
  231. <Button
  232. Command="{Binding DataContext.MoveDownCommand, RelativeSource={RelativeSource AncestorType=ItemsControl, Mode=FindAncestor}}"
  233. CommandParameter="{Binding}"
  234. Content="下移"
  235. FontSize="16"
  236. Style="{StaticResource IssueRecipeButtonStyle}" />
  237. <Border
  238. BorderBrush="{StaticResource bordColor}"
  239. BorderThickness="2,0,2,0"
  240. Cursor="SizeWE" />
  241. </Grid>
  242. <Grid Grid.Column="5">
  243. <Button
  244. Command="{Binding DataContext.RemoveCommand, RelativeSource={RelativeSource AncestorType=ItemsControl, Mode=FindAncestor}}"
  245. CommandParameter="{Binding}"
  246. Content="删除"
  247. FontSize="16"
  248. Style="{StaticResource ControlButtonStyle}" />
  249. <Border
  250. BorderBrush="{StaticResource bordColor}"
  251. BorderThickness="1,0,1,0"
  252. Cursor="SizeWE" />
  253. </Grid>
  254. <Border
  255. Grid.ColumnSpan="10"
  256. BorderBrush="{StaticResource bordColor}"
  257. BorderThickness="1,0,1,1" />
  258. </Grid>
  259. <DataTemplate.Triggers>
  260. <Trigger Property="IsMouseOver" Value="true">
  261. <Setter TargetName="gr" Property="Background" Value="#112AB2E7" />
  262. </Trigger>
  263. </DataTemplate.Triggers>
  264. </DataTemplate>
  265. </ItemsControl.ItemTemplate>
  266. </ItemsControl>
  267. </ScrollViewer>
  268. </Grid>
  269. <!--#endregion-->
  270. </Grid>
  271. <!--#endregion-->
  272. </Grid>
  273. </Border>
  274. </Window>