|
- <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.DataContext>
- <vm:RecipeSetViewModel></vm:RecipeSetViewModel>
- </UserControl.DataContext>
- <UserControl.Resources>
- <SolidColorBrush x:Key="BorderSolid" Color="#5523CACA" />
- <SolidColorBrush x:Key="FontColor" Color="#FF2AB2E7" />
- <SolidColorBrush x:Key="TitleFontColor" Color="#ddd" />
- <SolidColorBrush x:Key="CursorColor" Color="Aqua" />
- <SolidColorBrush x:Key="TitleBorderColor" Color="#FF2AB2E7" />
- <SolidColorBrush x:Key="TextBlockForeground" Color="#9934F7F7" />
-
- <Style x:Key="TextBlockStyle" TargetType="TextBlock">
- <Setter Property="FontFamily" Value="楷体" />
- <Setter Property="FontSize" Value="16" />
- <Setter Property="Background" Value="Transparent" />
- <!--<Setter Property="Foreground" Value="{StaticResource FontColor}" />-->
- <Setter Property="VerticalAlignment" Value="Center" />
- <Setter Property="HorizontalAlignment" Value="Center" />
- </Style>
-
- <Style x:Key="buttonStyle" TargetType="Button">
- <Setter Property="Background" Value="Transparent" />
- <Setter Property="FontSize" Value="16" />
- <Setter Property="Foreground" Value="Aqua" />
- <Setter Property="HorizontalAlignment" Value="Center" />
- <Setter Property="BorderThickness" Value="0" />
- <Style.Triggers>
- <Trigger Property="IsMouseOver" Value="True">
- <Setter Property="Cursor" Value="Hand"></Setter>
- </Trigger>
- </Style.Triggers>
- </Style>
-
- </UserControl.Resources>
- <Grid>
- <Grid.RowDefinitions>
- <RowDefinition Height="55"></RowDefinition>
- <RowDefinition Height="30"></RowDefinition>
- <RowDefinition></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>
- <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>
-
- </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.ColumnDefinitions>
- <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"/>
- </Grid>
- <ScrollViewer Grid.Row="2" HorizontalScrollBarVisibility="Hidden" VerticalScrollBarVisibility="Hidden" Padding="0,5,0,0">
- <ItemsControl ItemsSource="{Binding recipeModels}">
- <ItemsControl.ItemsPanel>
- <ItemsPanelTemplate>
- <StackPanel></StackPanel>
- </ItemsPanelTemplate>
- </ItemsControl.ItemsPanel>
- <ItemsControl.ItemTemplate>
- <DataTemplate>
- <RadioButton>
- <RadioButton.Template>
- <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>-->
-
- </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>
-
- </Grid>
- <ControlTemplate.Triggers>
- <Trigger Property="IsMouseOver" Value="true">
- <Setter TargetName="gr" Property="Background" Value="#3300ccff" />
- </Trigger>
- </ControlTemplate.Triggers>
- </ControlTemplate>
- </RadioButton.Template>
- </RadioButton>
-
- </DataTemplate>
- </ItemsControl.ItemTemplate>
- </ItemsControl>
- </ScrollViewer>
- </Grid>
- </UserControl>
|