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

193 lines
9.1 KiB

  1. <UserControl
  2. x:Class="FryPot_DosingSystem.View.RecipeSetView"
  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:FryPot_DosingSystem.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:FryPot_DosingSystem.ViewModel"
  10. d:DesignHeight="450"
  11. d:DesignWidth="800"
  12. mc:Ignorable="d">
  13. <UserControl.DataContext>
  14. <vm:RecipeSetViewModel />
  15. </UserControl.DataContext>
  16. <UserControl.Resources>
  17. <SolidColorBrush x:Key="BorderSolid" Color="#5523CACA" />
  18. <SolidColorBrush x:Key="FontColor" Color="#FF2AB2E7" />
  19. <SolidColorBrush x:Key="TitleFontColor" Color="#ddd" />
  20. <SolidColorBrush x:Key="CursorColor" Color="Aqua" />
  21. <SolidColorBrush x:Key="TitleBorderColor" Color="#FF2AB2E7" />
  22. <SolidColorBrush x:Key="TextBlockForeground" Color="#9934F7F7" />
  23. <Style x:Key="TextBlockStyle" TargetType="TextBlock">
  24. <Setter Property="FontFamily" Value="楷体" />
  25. <Setter Property="FontSize" Value="16" />
  26. <Setter Property="Background" Value="Transparent" />
  27. <!--<Setter Property="Foreground" Value="{StaticResource FontColor}" />-->
  28. <Setter Property="VerticalAlignment" Value="Center" />
  29. <Setter Property="HorizontalAlignment" Value="Center" />
  30. </Style>
  31. <Style x:Key="buttonStyle" TargetType="Button">
  32. <Setter Property="Background" Value="Transparent" />
  33. <Setter Property="FontSize" Value="16" />
  34. <Setter Property="Foreground" Value="Aqua" />
  35. <Setter Property="HorizontalAlignment" Value="Center" />
  36. <Setter Property="BorderThickness" Value="0" />
  37. <Style.Triggers>
  38. <Trigger Property="IsMouseOver" Value="True">
  39. <Setter Property="Cursor" Value="Hand" />
  40. </Trigger>
  41. </Style.Triggers>
  42. </Style>
  43. </UserControl.Resources>
  44. <Grid>
  45. <Grid.RowDefinitions>
  46. <RowDefinition Height="55" />
  47. <RowDefinition Height="30" />
  48. <RowDefinition />
  49. </Grid.RowDefinitions>
  50. <UniformGrid Columns="2">
  51. <Image HorizontalAlignment="Left" Source="../hbl.ico" />
  52. <StackPanel
  53. Grid.Column="2"
  54. HorizontalAlignment="Right"
  55. Orientation="Horizontal">
  56. <pry:IcoButton
  57. Width="150"
  58. Margin="80,15,10,0"
  59. Command="{Binding NewRecipe}"
  60. Content="新建配方"
  61. Cursor="Hand"
  62. FontSize="16"
  63. Foreground="Aqua"
  64. IcoText="&#xe626;"
  65. Style="{StaticResource IcoButtonStyle}" />
  66. <pry:IcoButton
  67. Width="150"
  68. Margin="5,15,10,0"
  69. Command="{Binding SaveRecipe}"
  70. Content="保存配方"
  71. Cursor="Hand"
  72. FontSize="16"
  73. Foreground="Aqua"
  74. IcoText="&#xe626;"
  75. Style="{StaticResource IcoButtonStyle}" />
  76. </StackPanel>
  77. </UniformGrid>
  78. <!--<TextBlock Grid.Row="1" Text="配方信息" Foreground="Aquamarine" HorizontalAlignment="Center" VerticalAlignment="Center" FontSize="18" Margin="0,5" ></TextBlock>-->
  79. <!--<Line Grid.Row="1" X1="0" Y1="5" X2="1920" Y2="10" Stroke="Aqua" VerticalAlignment="Center"></Line>-->
  80. <Grid
  81. Grid.Row="1"
  82. Margin="0,5,0,0"
  83. Background="Cyan">
  84. <Grid.ColumnDefinitions>
  85. <ColumnDefinition Width="0.3*" />
  86. <ColumnDefinition Width="0.3*" />
  87. <ColumnDefinition Width="0.3*" />
  88. <!--<ColumnDefinition/>-->
  89. </Grid.ColumnDefinitions>
  90. <!--<TextBlock Text="编号" FontSize="16" Foreground="Tomato" HorizontalAlignment="Center" VerticalAlignment="Center"/>-->
  91. <TextBlock
  92. Grid.Column="0"
  93. HorizontalAlignment="Center"
  94. VerticalAlignment="Center"
  95. FontSize="16"
  96. Foreground="Tomato"
  97. Text="配方名称" />
  98. <GridSplitter BorderBrush="CadetBlue" BorderThickness="0.5" />
  99. <TextBlock
  100. Grid.Column="1"
  101. HorizontalAlignment="Center"
  102. VerticalAlignment="Center"
  103. FontSize="16"
  104. Foreground="Tomato"
  105. Text="编辑配方" />
  106. <GridSplitter
  107. Grid.Column="1"
  108. BorderBrush="CadetBlue"
  109. BorderThickness="0.5" />
  110. <TextBlock
  111. Grid.Column="2"
  112. HorizontalAlignment="Center"
  113. VerticalAlignment="Center"
  114. FontSize="16"
  115. Foreground="Tomato"
  116. Text="删除配方" />
  117. </Grid>
  118. <ScrollViewer
  119. Grid.Row="2"
  120. Padding="0,5,0,0"
  121. HorizontalScrollBarVisibility="Hidden"
  122. VerticalScrollBarVisibility="Hidden">
  123. <ItemsControl ItemsSource="{Binding recipeModels}">
  124. <ItemsControl.ItemsPanel>
  125. <ItemsPanelTemplate>
  126. <StackPanel />
  127. </ItemsPanelTemplate>
  128. </ItemsControl.ItemsPanel>
  129. <ItemsControl.ItemTemplate>
  130. <DataTemplate>
  131. <RadioButton>
  132. <RadioButton.Template>
  133. <ControlTemplate>
  134. <Grid x:Name="gr">
  135. <Grid.ColumnDefinitions>
  136. <ColumnDefinition Width="0.25*" />
  137. <ColumnDefinition Width="0.25*" />
  138. <ColumnDefinition Width="0.25*" />
  139. <!--<ColumnDefinition Width="0.25*"></ColumnDefinition>-->
  140. </Grid.ColumnDefinitions>
  141. <!--<TextBlock Text="{Binding RecipeId}" Grid.Column="0" FontSize="16" HorizontalAlignment="Left" VerticalAlignment="Center"
  142. Foreground="Aqua"
  143. Margin="5,0,0,5"></TextBlock>-->
  144. <TextBlock
  145. Grid.Column="0"
  146. Margin="5,0,0,5"
  147. HorizontalAlignment="Center"
  148. VerticalAlignment="Center"
  149. FontSize="16"
  150. Foreground="Aqua"
  151. Text="{Binding RecipeName}" />
  152. <Button
  153. Grid.Column="1"
  154. Margin="5,0,0,5"
  155. Command="{Binding DataContext.EditRecipeCommand, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=ItemsControl}}"
  156. CommandParameter="{Binding RecipeId}"
  157. Content="编辑"
  158. FontSize="16"
  159. Style="{StaticResource buttonStyle}" />
  160. <Button
  161. Grid.Column="2"
  162. Margin="5,0,0,5"
  163. Command="{Binding DataContext.DeleteRecipeCommand, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=ItemsControl}}"
  164. CommandParameter="{Binding RecipeId}"
  165. Content="删除"
  166. FontSize="16"
  167. Style="{StaticResource buttonStyle}" />
  168. </Grid>
  169. <ControlTemplate.Triggers>
  170. <Trigger Property="IsMouseOver" Value="true">
  171. <Setter TargetName="gr" Property="Background" Value="#3300ccff" />
  172. </Trigger>
  173. </ControlTemplate.Triggers>
  174. </ControlTemplate>
  175. </RadioButton.Template>
  176. </RadioButton>
  177. </DataTemplate>
  178. </ItemsControl.ItemTemplate>
  179. </ItemsControl>
  180. </ScrollViewer>
  181. </Grid>
  182. </UserControl>