|
- <UserControl x:Class="FryPot_DosingSystem.View.RecipeManageView"
- 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:vm="clr-namespace:FryPot_DosingSystem.ViewModel"
- xmlns:pry="clr-namespace:BPASmartClient.CustomResource.UserControls;assembly=BPASmartClient.CustomResource"
- mc:Ignorable="d"
- d:DesignHeight="450" d:DesignWidth="800">
- <UserControl.DataContext>
- <vm:RecipeSetViewModel/>
- </UserControl.DataContext>
- <UserControl.Resources>
- <Style x:Key="GridResize" TargetType="Grid">
- <Style.Triggers>
- <!--<Trigger Property="IsMouseOver" Value="False"/>-->
- <EventTrigger RoutedEvent="MouseEnter" >
- <BeginStoryboard>
- <Storyboard>
- <DoubleAnimation Duration="0:0:0.2" To="236" Storyboard.TargetProperty="Width"/>
- <DoubleAnimation Duration="0:0:0.2" To="281" Storyboard.TargetProperty="Height"/>
- </Storyboard>
- </BeginStoryboard>
- </EventTrigger>
- <EventTrigger RoutedEvent="MouseLeave" >
- <BeginStoryboard>
- <Storyboard>
- <DoubleAnimation Duration="0:0:0.2" To="235" Storyboard.TargetProperty="Width"/>
- <DoubleAnimation Duration="0:0:0.2" To="280" Storyboard.TargetProperty="Height"/>
- </Storyboard>
- </BeginStoryboard>
- </EventTrigger>
- </Style.Triggers>
- </Style>
- <Style x:Key="FocusVisual">
- <Setter Property="Control.Template">
- <Setter.Value>
- <ControlTemplate>
- <Rectangle Margin="2" StrokeDashArray="1 2" Stroke="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}" SnapsToDevicePixels="true" StrokeThickness="1"/>
- </ControlTemplate>
- </Setter.Value>
- </Setter>
- </Style>
- <SolidColorBrush x:Key="Button.Static.Background" Color="#FFDDDDDD"/>
- <SolidColorBrush x:Key="Button.Static.Border" Color="#FF707070"/>
- <SolidColorBrush x:Key="Button.MouseOver.Background" Color="Transparent"/>
- <SolidColorBrush x:Key="Button.MouseOver.Border" Color="#FF3C7FB1"/>
- <SolidColorBrush x:Key="Button.Pressed.Background" Color="#FFC4E5F6"/>
- <SolidColorBrush x:Key="Button.Pressed.Border" Color="#FF2C628B"/>
- <SolidColorBrush x:Key="Button.Disabled.Background" Color="#FFF4F4F4"/>
- <SolidColorBrush x:Key="Button.Disabled.Border" Color="#FFADB2B5"/>
- <SolidColorBrush x:Key="Button.Disabled.Foreground" Color="#FF838383"/>
- <Style x:Key="ButtonStyle1" TargetType="{x:Type Button}">
- <Setter Property="FocusVisualStyle" Value="{StaticResource FocusVisual}"/>
- <Setter Property="Background" Value="{StaticResource Button.Static.Background}"/>
- <Setter Property="BorderBrush" Value="{StaticResource Button.Static.Border}"/>
- <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}"/>
- <Setter Property="BorderThickness" Value="1"/>
- <Setter Property="HorizontalContentAlignment" Value="Center"/>
- <Setter Property="VerticalContentAlignment" Value="Center"/>
- <Setter Property="Padding" Value="1"/>
- <Setter Property="Template">
- <Setter.Value>
- <ControlTemplate TargetType="{x:Type Button}">
- <Border x:Name="border" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" SnapsToDevicePixels="true">
- <ContentPresenter x:Name="contentPresenter" Focusable="False" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="{TemplateBinding Padding}" RecognizesAccessKey="True" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
- </Border>
- <ControlTemplate.Triggers>
- <Trigger Property="IsDefaulted" Value="true">
- <Setter Property="BorderBrush" TargetName="border" Value="{DynamicResource {x:Static SystemColors.HighlightBrushKey}}"/>
- </Trigger>
- <Trigger Property="IsMouseOver" Value="true">
- <Setter Property="Background" TargetName="border" Value="{StaticResource Button.MouseOver.Background}"/>
- <Setter Property="BorderBrush" TargetName="border" Value="{StaticResource Button.MouseOver.Border}"/>
- </Trigger>
- <Trigger Property="IsPressed" Value="true">
- <Setter Property="Background" TargetName="border" Value="{StaticResource Button.Pressed.Background}"/>
- <Setter Property="BorderBrush" TargetName="border" Value="{StaticResource Button.Pressed.Border}"/>
- </Trigger>
- <Trigger Property="IsEnabled" Value="false">
- <Setter Property="Background" TargetName="border" Value="{StaticResource Button.Disabled.Background}"/>
- <Setter Property="BorderBrush" TargetName="border" Value="{StaticResource Button.Disabled.Border}"/>
- <Setter Property="TextElement.Foreground" TargetName="contentPresenter" Value="{StaticResource Button.Disabled.Foreground}"/>
- </Trigger>
- </ControlTemplate.Triggers>
- </ControlTemplate>
- </Setter.Value>
- </Setter>
- </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>
- <ScrollViewer Grid.Row="2" HorizontalScrollBarVisibility="Disabled" VerticalScrollBarVisibility="Hidden" Padding="0,5,0,0">
- <ItemsControl ItemsSource="{Binding recipeModels}">
- <ItemsControl.ItemsPanel>
- <ItemsPanelTemplate>
- <WrapPanel></WrapPanel>
- </ItemsPanelTemplate>
- </ItemsControl.ItemsPanel>
- <ItemsControl.ItemTemplate>
- <DataTemplate>
- <Grid Width="235" Height="280" Margin="6,6" Style="{StaticResource GridResize}">
- <Grid.RowDefinitions>
- <RowDefinition Height="150"/>
- <RowDefinition />
- </Grid.RowDefinitions>
- <Button Panel.ZIndex="1" VerticalAlignment="Top" Background="Transparent" HorizontalAlignment="Right" Width="15" Height="15" FontFamily="/BPASmartClient.CustomResource;component/Fonts/#iconfont" Content="" BorderThickness="0" Foreground="LightGray" Command="{Binding DataContext.DeleteRecipeCommand,RelativeSource={RelativeSource Mode=FindAncestor,AncestorType=ItemsControl}}" CommandParameter="{Binding RecipeId}"></Button>
- <Image Stretch="Fill" Source="/BPASmartClient.CustomResource;component/Image/调味品.jpeg"/>
- <StackPanel Grid.Row="2">
- <StackPanel.Background>
- <ImageBrush ImageSource="/BPASmartClient.CustomResource;component/Image/浅色背景.jpeg" Opacity="0.4"/>
- </StackPanel.Background>
- <StackPanel Orientation="Horizontal" Margin="0,5">
- <TextBlock Text="配方:" Foreground="White" FontSize="18"></TextBlock>
- <TextBlock Text="{Binding RecipeName}" Foreground="Orange" FontSize="18"></TextBlock>
- </StackPanel>
- <StackPanel Orientation="Horizontal" Margin="0,5">
- <TextBlock Text="操作:" Foreground="White" FontSize="18"></TextBlock>
- <Button Style="{DynamicResource ButtonStyle1}" Content="编辑" Cursor="Hand" Foreground="Orange" FontSize="18" Background="Transparent" BorderThickness="0" Command="{Binding DataContext.EditRecipeCommand,RelativeSource={RelativeSource Mode=FindAncestor,AncestorType=ItemsControl}}"
- CommandParameter="{Binding RecipeId}"/>
- <Button Style="{DynamicResource ButtonStyle1}" Margin="15,0,0,0" Content="复制" Cursor="Hand" Foreground="Orange" FontSize="18" Background="Transparent" BorderThickness="0" Command="{Binding DataContext.CopyRecipeCommand,RelativeSource={RelativeSource Mode=FindAncestor,AncestorType=ItemsControl}}"
- CommandParameter="{Binding RecipeId}"/>
- <Button Margin="15,0,0,0" Style="{DynamicResource ButtonStyle1}" Content="炒制工艺" Cursor="Hand" Foreground="Orange" FontSize="18" Background="Transparent" BorderThickness="0" Command="{Binding DataContext.OperateFlowProcess,RelativeSource={RelativeSource Mode=FindAncestor,AncestorType=ItemsControl}}" CommandParameter="{Binding RecipeName}"/>
- </StackPanel>
- <StackPanel Orientation="Horizontal" Margin="0,5">
- <TextBlock Text="创建时间:" FontSize="18" Foreground="White"></TextBlock>
- <TextBlock Text="{Binding DataTime}" FontSize="18" Foreground="Orange"/>
- </StackPanel>
- <StackPanel Orientation="Horizontal" Margin="0,5">
- <TextBlock Text="更新时间:" FontSize="18" Foreground="White"></TextBlock>
- <TextBlock Text="{Binding UpdateTime}" FontSize="18" Foreground="Orange"/>
- </StackPanel>
- </StackPanel>
-
- </Grid>
- </DataTemplate>
- </ItemsControl.ItemTemplate>
- </ItemsControl>
- </ScrollViewer>
- </Grid>
- </UserControl>
|