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

143 lines
8.6 KiB

  1. <UserControl x:Class="FryPot_DosingSystem.View.RecipeSetView"
  2. xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  3. xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  4. xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
  5. xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
  6. xmlns:local="clr-namespace:FryPot_DosingSystem.View"
  7. xmlns:pry="clr-namespace:BPASmartClient.CustomResource.UserControls;assembly=BPASmartClient.CustomResource"
  8. xmlns:vm="clr-namespace:FryPot_DosingSystem.ViewModel"
  9. mc:Ignorable="d"
  10. d:DesignHeight="450" d:DesignWidth="800">
  11. <UserControl.DataContext>
  12. <vm:RecipeSetViewModel></vm:RecipeSetViewModel>
  13. </UserControl.DataContext>
  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="16" />
  24. <Setter Property="Background" Value="Transparent" />
  25. <!--<Setter Property="Foreground" Value="{StaticResource FontColor}" />-->
  26. <Setter Property="VerticalAlignment" Value="Center" />
  27. <Setter Property="HorizontalAlignment" Value="Center" />
  28. </Style>
  29. <Style x:Key="buttonStyle" TargetType="Button">
  30. <Setter Property="Background" Value="Transparent" />
  31. <Setter Property="FontSize" Value="16" />
  32. <Setter Property="Foreground" Value="Aqua" />
  33. <Setter Property="HorizontalAlignment" Value="Center" />
  34. <Setter Property="BorderThickness" Value="0" />
  35. <Style.Triggers>
  36. <Trigger Property="IsMouseOver" Value="True">
  37. <Setter Property="Cursor" Value="Hand"></Setter>
  38. </Trigger>
  39. </Style.Triggers>
  40. </Style>
  41. </UserControl.Resources>
  42. <Grid>
  43. <Grid.RowDefinitions>
  44. <RowDefinition Height="55"></RowDefinition>
  45. <RowDefinition Height="30"></RowDefinition>
  46. <RowDefinition></RowDefinition>
  47. </Grid.RowDefinitions>
  48. <UniformGrid Columns="2">
  49. <Image Source="../hbl.ico" HorizontalAlignment="Left"></Image>
  50. <StackPanel Orientation="Horizontal" HorizontalAlignment="Right" Grid.Column="2">
  51. <pry:IcoButton Content="新建配方"
  52. Margin="80,15,10,0"
  53. Width="150"
  54. FontSize="16"
  55. Foreground="Aqua"
  56. IcoText="&#xe626;"
  57. Cursor="Hand"
  58. Style="{StaticResource IcoButtonStyle}"
  59. Command="{Binding NewRecipe}">
  60. </pry:IcoButton>
  61. <pry:IcoButton
  62. Content="保存配方" Margin="5,15,10,0"
  63. Width="150"
  64. FontSize="16"
  65. Foreground="Aqua"
  66. IcoText="&#xe626;"
  67. Cursor="Hand"
  68. Style="{StaticResource IcoButtonStyle}"
  69. Command="{Binding SaveRecipe}">
  70. </pry:IcoButton>
  71. </StackPanel>
  72. </UniformGrid>
  73. <!--<TextBlock Grid.Row="1" Text="配方信息" Foreground="Aquamarine" HorizontalAlignment="Center" VerticalAlignment="Center" FontSize="18" Margin="0,5" ></TextBlock>-->
  74. <!--<Line Grid.Row="1" X1="0" Y1="5" X2="1920" Y2="10" Stroke="Aqua" VerticalAlignment="Center"></Line>-->
  75. <Grid Grid.Row="1" Background="Cyan" Margin="0,5,0,0">
  76. <Grid.ColumnDefinitions>
  77. <ColumnDefinition Width="0.3*"/>
  78. <ColumnDefinition Width="0.3*"/>
  79. <ColumnDefinition Width="0.3*"/>
  80. <!--<ColumnDefinition/>-->
  81. </Grid.ColumnDefinitions>
  82. <!--<TextBlock Text="编号" FontSize="16" Foreground="Tomato" HorizontalAlignment="Center" VerticalAlignment="Center"/>-->
  83. <TextBlock Grid.Column="0" Text="配方名称" FontSize="16" Foreground="Tomato" HorizontalAlignment="Center" VerticalAlignment="Center"/>
  84. <GridSplitter BorderThickness="0.5" BorderBrush="CadetBlue"/>
  85. <TextBlock Grid.Column="1" Text="编辑配方" FontSize="16" Foreground="Tomato" HorizontalAlignment="Center" VerticalAlignment="Center"/>
  86. <GridSplitter Grid.Column="1" BorderThickness="0.5" BorderBrush="CadetBlue"></GridSplitter>
  87. <TextBlock Grid.Column="2" Text="删除配方" FontSize="16" Foreground="Tomato" HorizontalAlignment="Center" VerticalAlignment="Center"/>
  88. </Grid>
  89. <ScrollViewer Grid.Row="2" HorizontalScrollBarVisibility="Hidden" VerticalScrollBarVisibility="Hidden" Padding="0,5,0,0">
  90. <ItemsControl ItemsSource="{Binding recipeModels}">
  91. <ItemsControl.ItemsPanel>
  92. <ItemsPanelTemplate>
  93. <StackPanel></StackPanel>
  94. </ItemsPanelTemplate>
  95. </ItemsControl.ItemsPanel>
  96. <ItemsControl.ItemTemplate>
  97. <DataTemplate>
  98. <RadioButton>
  99. <RadioButton.Template>
  100. <ControlTemplate>
  101. <Grid x:Name="gr">
  102. <Grid.ColumnDefinitions>
  103. <ColumnDefinition Width="0.25*"></ColumnDefinition>
  104. <ColumnDefinition Width="0.25*"></ColumnDefinition>
  105. <ColumnDefinition Width="0.25*"></ColumnDefinition>
  106. <!--<ColumnDefinition Width="0.25*"></ColumnDefinition>-->
  107. </Grid.ColumnDefinitions>
  108. <!--<TextBlock Text="{Binding RecipeId}" Grid.Column="0" FontSize="16" HorizontalAlignment="Left" VerticalAlignment="Center"
  109. Foreground="Aqua"
  110. Margin="5,0,0,5"></TextBlock>-->
  111. <TextBlock Text="{Binding RecipeName}" Grid.Column="0" Margin="5,0,0,5"
  112. HorizontalAlignment="Center" VerticalAlignment="Center" Foreground="Aqua" FontSize="16"></TextBlock>
  113. <Button FontSize="16" Grid.Column="1"
  114. Margin="5,0,0,5" Content="编辑" Style="{StaticResource buttonStyle}" Command="{Binding DataContext.EditRecipeCommand,RelativeSource={RelativeSource Mode=FindAncestor,AncestorType=ItemsControl}}"
  115. CommandParameter="{Binding RecipeId}"></Button>
  116. <Button Margin="5,0,0,5" FontSize="16" Grid.Column="2" Content="删除" Style="{StaticResource buttonStyle}" Command="{Binding DataContext.DeleteRecipeCommand,RelativeSource={RelativeSource Mode=FindAncestor,AncestorType=ItemsControl}}" CommandParameter="{Binding RecipeId}">
  117. </Button>
  118. </Grid>
  119. <ControlTemplate.Triggers>
  120. <Trigger Property="IsMouseOver" Value="true">
  121. <Setter TargetName="gr" Property="Background" Value="#3300ccff" />
  122. </Trigger>
  123. </ControlTemplate.Triggers>
  124. </ControlTemplate>
  125. </RadioButton.Template>
  126. </RadioButton>
  127. </DataTemplate>
  128. </ItemsControl.ItemTemplate>
  129. </ItemsControl>
  130. </ScrollViewer>
  131. </Grid>
  132. </UserControl>