|
|
@@ -1,15 +1,17 @@ |
|
|
|
<UserControl x:Class="FryPot_DosingSystem.View.RecipeSetView" |
|
|
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" |
|
|
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" |
|
|
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" |
|
|
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" |
|
|
|
xmlns:local="clr-namespace:FryPot_DosingSystem.View" |
|
|
|
xmlns:pry="clr-namespace:BPASmartClient.CustomResource.UserControls;assembly=BPASmartClient.CustomResource" |
|
|
|
xmlns:vm="clr-namespace:FryPot_DosingSystem.ViewModel" |
|
|
|
mc:Ignorable="d" |
|
|
|
d:DesignHeight="450" d:DesignWidth="800"> |
|
|
|
<UserControl |
|
|
|
x:Class="FryPot_DosingSystem.View.RecipeSetView" |
|
|
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" |
|
|
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" |
|
|
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" |
|
|
|
xmlns:local="clr-namespace:FryPot_DosingSystem.View" |
|
|
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" |
|
|
|
xmlns:pry="clr-namespace:BPASmartClient.CustomResource.UserControls;assembly=BPASmartClient.CustomResource" |
|
|
|
xmlns:vm="clr-namespace:FryPot_DosingSystem.ViewModel" |
|
|
|
d:DesignHeight="450" |
|
|
|
d:DesignWidth="800" |
|
|
|
mc:Ignorable="d"> |
|
|
|
<UserControl.DataContext> |
|
|
|
<vm:RecipeSetViewModel></vm:RecipeSetViewModel> |
|
|
|
<vm:RecipeSetViewModel /> |
|
|
|
</UserControl.DataContext> |
|
|
|
<UserControl.Resources> |
|
|
|
<SolidColorBrush x:Key="BorderSolid" Color="#5523CACA" /> |
|
|
@@ -36,7 +38,7 @@ |
|
|
|
<Setter Property="BorderThickness" Value="0" /> |
|
|
|
<Style.Triggers> |
|
|
|
<Trigger Property="IsMouseOver" Value="True"> |
|
|
|
<Setter Property="Cursor" Value="Hand"></Setter> |
|
|
|
<Setter Property="Cursor" Value="Hand" /> |
|
|
|
</Trigger> |
|
|
|
</Style.Triggers> |
|
|
|
</Style> |
|
|
@@ -44,57 +46,88 @@ |
|
|
|
</UserControl.Resources> |
|
|
|
<Grid> |
|
|
|
<Grid.RowDefinitions> |
|
|
|
<RowDefinition Height="55"></RowDefinition> |
|
|
|
<RowDefinition Height="30"></RowDefinition> |
|
|
|
<RowDefinition></RowDefinition> |
|
|
|
<RowDefinition Height="55" /> |
|
|
|
<RowDefinition Height="30" /> |
|
|
|
<RowDefinition /> |
|
|
|
</Grid.RowDefinitions> |
|
|
|
<UniformGrid Columns="2"> |
|
|
|
<Image Source="../hbl.ico" HorizontalAlignment="Left"></Image> |
|
|
|
<StackPanel Orientation="Horizontal" HorizontalAlignment="Right" Grid.Column="2"> |
|
|
|
<pry:IcoButton Content="新建配方" |
|
|
|
Margin="80,15,10,0" |
|
|
|
Width="150" |
|
|
|
FontSize="16" |
|
|
|
Foreground="Aqua" |
|
|
|
IcoText="" |
|
|
|
Cursor="Hand" |
|
|
|
Style="{StaticResource IcoButtonStyle}" |
|
|
|
Command="{Binding NewRecipe}"> |
|
|
|
</pry:IcoButton> |
|
|
|
<Image HorizontalAlignment="Left" Source="../hbl.ico" /> |
|
|
|
<StackPanel |
|
|
|
Grid.Column="2" |
|
|
|
HorizontalAlignment="Right" |
|
|
|
Orientation="Horizontal"> |
|
|
|
<pry:IcoButton |
|
|
|
Content="保存配方" Margin="5,15,10,0" |
|
|
|
Width="150" |
|
|
|
FontSize="16" |
|
|
|
Foreground="Aqua" |
|
|
|
IcoText="" |
|
|
|
Cursor="Hand" |
|
|
|
Style="{StaticResource IcoButtonStyle}" |
|
|
|
Command="{Binding SaveRecipe}"> |
|
|
|
</pry:IcoButton> |
|
|
|
Width="150" |
|
|
|
Margin="80,15,10,0" |
|
|
|
Command="{Binding NewRecipe}" |
|
|
|
Content="新建配方" |
|
|
|
Cursor="Hand" |
|
|
|
FontSize="16" |
|
|
|
Foreground="Aqua" |
|
|
|
IcoText="" |
|
|
|
Style="{StaticResource IcoButtonStyle}" /> |
|
|
|
<pry:IcoButton |
|
|
|
Width="150" |
|
|
|
Margin="5,15,10,0" |
|
|
|
Command="{Binding SaveRecipe}" |
|
|
|
Content="保存配方" |
|
|
|
Cursor="Hand" |
|
|
|
FontSize="16" |
|
|
|
Foreground="Aqua" |
|
|
|
IcoText="" |
|
|
|
Style="{StaticResource IcoButtonStyle}" /> |
|
|
|
|
|
|
|
</StackPanel> |
|
|
|
</UniformGrid> |
|
|
|
<!--<TextBlock Grid.Row="1" Text="配方信息" Foreground="Aquamarine" HorizontalAlignment="Center" VerticalAlignment="Center" FontSize="18" Margin="0,5" ></TextBlock>--> |
|
|
|
<!--<Line Grid.Row="1" X1="0" Y1="5" X2="1920" Y2="10" Stroke="Aqua" VerticalAlignment="Center"></Line>--> |
|
|
|
<Grid Grid.Row="1" Background="Cyan" Margin="0,5,0,0"> |
|
|
|
<Grid |
|
|
|
Grid.Row="1" |
|
|
|
Margin="0,5,0,0" |
|
|
|
Background="Cyan"> |
|
|
|
<Grid.ColumnDefinitions> |
|
|
|
<ColumnDefinition Width="0.3*"/> |
|
|
|
<ColumnDefinition Width="0.3*"/> |
|
|
|
<ColumnDefinition Width="0.3*"/> |
|
|
|
<ColumnDefinition Width="0.3*" /> |
|
|
|
<ColumnDefinition Width="0.3*" /> |
|
|
|
<ColumnDefinition Width="0.3*" /> |
|
|
|
<!--<ColumnDefinition/>--> |
|
|
|
</Grid.ColumnDefinitions> |
|
|
|
<!--<TextBlock Text="编号" FontSize="16" Foreground="Tomato" HorizontalAlignment="Center" VerticalAlignment="Center"/>--> |
|
|
|
<TextBlock Grid.Column="0" Text="配方名称" FontSize="16" Foreground="Tomato" HorizontalAlignment="Center" VerticalAlignment="Center"/> |
|
|
|
<GridSplitter BorderThickness="0.5" BorderBrush="CadetBlue"/> |
|
|
|
<TextBlock Grid.Column="1" Text="编辑配方" FontSize="16" Foreground="Tomato" HorizontalAlignment="Center" VerticalAlignment="Center"/> |
|
|
|
<GridSplitter Grid.Column="1" BorderThickness="0.5" BorderBrush="CadetBlue"></GridSplitter> |
|
|
|
<TextBlock Grid.Column="2" Text="删除配方" FontSize="16" Foreground="Tomato" HorizontalAlignment="Center" VerticalAlignment="Center"/> |
|
|
|
<TextBlock |
|
|
|
Grid.Column="0" |
|
|
|
HorizontalAlignment="Center" |
|
|
|
VerticalAlignment="Center" |
|
|
|
FontSize="16" |
|
|
|
Foreground="Tomato" |
|
|
|
Text="配方名称" /> |
|
|
|
<GridSplitter BorderBrush="CadetBlue" BorderThickness="0.5" /> |
|
|
|
<TextBlock |
|
|
|
Grid.Column="1" |
|
|
|
HorizontalAlignment="Center" |
|
|
|
VerticalAlignment="Center" |
|
|
|
FontSize="16" |
|
|
|
Foreground="Tomato" |
|
|
|
Text="编辑配方" /> |
|
|
|
<GridSplitter |
|
|
|
Grid.Column="1" |
|
|
|
BorderBrush="CadetBlue" |
|
|
|
BorderThickness="0.5" /> |
|
|
|
<TextBlock |
|
|
|
Grid.Column="2" |
|
|
|
HorizontalAlignment="Center" |
|
|
|
VerticalAlignment="Center" |
|
|
|
FontSize="16" |
|
|
|
Foreground="Tomato" |
|
|
|
Text="删除配方" /> |
|
|
|
</Grid> |
|
|
|
<ScrollViewer Grid.Row="2" HorizontalScrollBarVisibility="Hidden" VerticalScrollBarVisibility="Hidden" Padding="0,5,0,0"> |
|
|
|
<ScrollViewer |
|
|
|
Grid.Row="2" |
|
|
|
Padding="0,5,0,0" |
|
|
|
HorizontalScrollBarVisibility="Hidden" |
|
|
|
VerticalScrollBarVisibility="Hidden"> |
|
|
|
<ItemsControl ItemsSource="{Binding recipeModels}"> |
|
|
|
<ItemsControl.ItemsPanel> |
|
|
|
<ItemsPanelTemplate> |
|
|
|
<StackPanel></StackPanel> |
|
|
|
<StackPanel /> |
|
|
|
</ItemsPanelTemplate> |
|
|
|
</ItemsControl.ItemsPanel> |
|
|
|
<ItemsControl.ItemTemplate> |
|
|
@@ -104,26 +137,43 @@ |
|
|
|
<ControlTemplate> |
|
|
|
<Grid x:Name="gr"> |
|
|
|
<Grid.ColumnDefinitions> |
|
|
|
<ColumnDefinition Width="0.25*"></ColumnDefinition> |
|
|
|
<ColumnDefinition Width="0.25*"></ColumnDefinition> |
|
|
|
<ColumnDefinition Width="0.25*"></ColumnDefinition> |
|
|
|
<ColumnDefinition Width="0.25*" /> |
|
|
|
<ColumnDefinition Width="0.25*" /> |
|
|
|
<ColumnDefinition Width="0.25*" /> |
|
|
|
<!--<ColumnDefinition Width="0.25*"></ColumnDefinition>--> |
|
|
|
|
|
|
|
|
|
|
|
</Grid.ColumnDefinitions> |
|
|
|
<!--<TextBlock Text="{Binding RecipeId}" Grid.Column="0" FontSize="16" HorizontalAlignment="Left" VerticalAlignment="Center" |
|
|
|
Foreground="Aqua" |
|
|
|
Margin="5,0,0,5"></TextBlock>--> |
|
|
|
<TextBlock Text="{Binding RecipeName}" Grid.Column="0" Margin="5,0,0,5" |
|
|
|
HorizontalAlignment="Center" VerticalAlignment="Center" Foreground="Aqua" FontSize="16"></TextBlock> |
|
|
|
|
|
|
|
<Button FontSize="16" Grid.Column="1" |
|
|
|
Margin="5,0,0,5" Content="编辑" Style="{StaticResource buttonStyle}" Command="{Binding DataContext.EditRecipeCommand,RelativeSource={RelativeSource Mode=FindAncestor,AncestorType=ItemsControl}}" |
|
|
|
CommandParameter="{Binding RecipeId}"></Button> |
|
|
|
|
|
|
|
|
|
|
|
<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}"> |
|
|
|
</Button> |
|
|
|
|
|
|
|
<TextBlock |
|
|
|
Grid.Column="0" |
|
|
|
Margin="5,0,0,5" |
|
|
|
HorizontalAlignment="Center" |
|
|
|
VerticalAlignment="Center" |
|
|
|
FontSize="16" |
|
|
|
Foreground="Aqua" |
|
|
|
Text="{Binding RecipeName}" /> |
|
|
|
|
|
|
|
<Button |
|
|
|
Grid.Column="1" |
|
|
|
Margin="5,0,0,5" |
|
|
|
Command="{Binding DataContext.EditRecipeCommand, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=ItemsControl}}" |
|
|
|
CommandParameter="{Binding RecipeId}" |
|
|
|
Content="编辑" |
|
|
|
FontSize="16" |
|
|
|
Style="{StaticResource buttonStyle}" /> |
|
|
|
|
|
|
|
|
|
|
|
<Button |
|
|
|
Grid.Column="2" |
|
|
|
Margin="5,0,0,5" |
|
|
|
Command="{Binding DataContext.DeleteRecipeCommand, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=ItemsControl}}" |
|
|
|
CommandParameter="{Binding RecipeId}" |
|
|
|
Content="删除" |
|
|
|
FontSize="16" |
|
|
|
Style="{StaticResource buttonStyle}" /> |
|
|
|
|
|
|
|
</Grid> |
|
|
|
<ControlTemplate.Triggers> |
|
|
|
<Trigger Property="IsMouseOver" Value="true"> |
|
|
|