|
- <UserControl x:Class="BPASmartClient.JXJFoodBigStation.View.SiemensRecipeSendDownView"
- 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:con="clr-namespace:BPASmartClient.JXJFoodBigStation.Converter"
- xmlns:local="clr-namespace:BPASmartClient.JXJFoodBigStation.View"
- xmlns:pry="clr-namespace:BPASmartClient.CustomResource.UserControls;assembly=BPASmartClient.CustomResource"
- xmlns:vm="clr-namespace:BPASmartClient.JXJFoodBigStation.ViewModel"
- mc:Ignorable="d"
- d:DesignHeight="450" d:DesignWidth="800">
- <UserControl.DataContext>
- <vm:SiemensRecipeSendDownViewModel/>
- </UserControl.DataContext>
- <UserControl.Resources>
- <con:EnbleConvert x:Key="EnbleConvert"/>
- <con:IntToSourceConvert x:Key="IntToSourceConvert"/>
- <con:RunStatusConvert x:Key="RunStatusConvert"/>
- <Style x:Key="UserItemContainerStyle" TargetType="ListBoxItem">
- <Style.Resources>
- <!-- SelectedItem with focus -->
- <SolidColorBrush
- x:Key="{x:Static SystemColors.HighlightBrushKey}"
- Opacity=".4"
- Color="White" />
- <!-- SelectedItem without focus -->
- <SolidColorBrush
- x:Key="{x:Static SystemColors.ControlBrushKey}"
- Opacity=".4"
- Color="White" />
- </Style.Resources>
- <!-- 设置触发器 -->
- <Style.Triggers>
- <Trigger Property="IsMouseOver" Value="true">
- <Setter Property="Background" Value="White" />
- <Setter Property="Foreground" Value="White" />
- </Trigger>
- <Trigger Property="IsFocused" Value="true">
- <Setter Property="Background" Value="White" />
- <Setter Property="Foreground" Value="White" />
- </Trigger>
- </Style.Triggers>
- </Style>
-
- <Style x:Key="RadioState" TargetType="RadioButton">
- <Setter Property="Margin" Value="1" />
- <Setter Property="Background" Value="Transparent" />
- <Setter Property="Foreground" Value="#ddd" />
- <Setter Property="VerticalContentAlignment" Value="Bottom" />
- <Setter Property="Margin" Value="2,5" />
- <Setter Property="FontSize" Value="16" />
- <Setter Property="FontFamily" Value="Consolas" />
- <Setter Property="Template">
- <Setter.Value>
- <ControlTemplate TargetType="RadioButton">
- <Border
- Name="radiobutton"
- Background="{TemplateBinding Background}"
- CornerRadius="5"
- Opacity="0.85">
- <Grid>
- <!--<Border
- x:Name="back_border"
- BorderBrush="Black"
- BorderThickness="0"
- CornerRadius="1">
- <Border.Effect>
- <BlurEffect KernelType="Gaussian" Radius="2" />
- </Border.Effect>
- </Border>
- <Border
- x:Name="fore_border"
- Margin="2"
- BorderBrush="White"
- BorderThickness="0"
- CornerRadius="{Binding ElementName=button, Path=CornerRadius}"
- Opacity="0.7">
- <Border.Effect>
- <BlurEffect KernelType="Gaussian" Radius="2" />
- </Border.Effect>
- </Border>-->
-
-
- <ContentPresenter
- HorizontalAlignment="Center"
- VerticalAlignment="Center"
- Content="{TemplateBinding Content}"
- TextBlock.FontFamily="{TemplateBinding FontFamily}"
- TextBlock.FontSize="{TemplateBinding FontSize}"
- TextBlock.Foreground="{TemplateBinding Foreground}" />
-
- <Image
- Name="im"
- Source="/BPASmartClient.CustomResource;component/Image/按钮/组 8.png"
- Stretch="Fill" />
- </Grid>
- </Border>
-
- <ControlTemplate.Triggers>
- <Trigger Property="IsChecked" Value="True">
- <!--<Setter TargetName="back_border" Property="BorderThickness" Value="1,0,1,1" />
- <Setter TargetName="back_border" Property="CornerRadius" Value="5" />
- <Setter TargetName="fore_border" Property="BorderThickness" Value="0,2,0,0" />
- <Setter Property="Background" Value=" #4169E1" />-->
- <Setter TargetName="im" Property="Source" Value="/BPASmartClient.CustomResource;component/Image/按钮/组 7.png" />
-
- </Trigger>
-
- <Trigger Property="IsChecked" Value="False">
- <Setter TargetName="im" Property="Source" Value="/BPASmartClient.CustomResource;component/Image/按钮/组 8.png" />
- </Trigger>
-
- <Trigger Property="IsMouseOver" Value="True">
- <!--<Setter TargetName="back_border" Property="BorderBrush" Value="white" />
- <Setter TargetName="back_border" Property="BorderThickness" Value="1,1,1,1" />-->
- <Setter TargetName="radiobutton" Property="Opacity" Value="1" />
- <!--<Setter TargetName="im" Property="Source" Value="/BPASmartClient.CustomResource;component/Image/按钮背景蓝色.png" />-->
- </Trigger>
- </ControlTemplate.Triggers>
- </ControlTemplate>
-
- </Setter.Value>
-
- </Setter>
-
- </Style>
- <Style x:Key="materialMakingButton" TargetType="Button">
- <Setter Property="Background" Value="Transparent" />
- <Setter Property="FontSize" Value="16" />
- <Setter Property="Foreground" Value="#CD5555" />
- <Setter Property="BorderThickness" Value="0" />
- <Setter Property="HorizontalAlignment" Value="Left" />
- <Setter Property="Template">
- <Setter.Value>
- <ControlTemplate>
- <Border
- x:Name="brState"
- Padding="2"
- BorderBrush="White"
- BorderThickness="0">
- <TextBlock
- x:Name="txState"
- Margin="1"
- HorizontalAlignment="Center"
- VerticalAlignment="Center"
- Text="{Binding RecipeStatus, Converter={StaticResource RunStatusConvert}}" />
- </Border>
- <ControlTemplate.Triggers>
- <Trigger Property="IsEnabled" Value="True">
- <Setter TargetName="brState" Property="BorderThickness" Value="0" />
- <Setter TargetName="brState" Property="CornerRadius" Value="5" />
- <Setter TargetName="brState" Property="Background" Value="#F0FFFF" />
- <Setter TargetName="txState" Property="Foreground" Value="#CD5555" />
- </Trigger>
- <DataTrigger Binding="{Binding RecipeStatus}" Value="3">
- <Setter TargetName="brState" Property="Background" Value="#F0FFFF" />
- <Setter TargetName="txState" Property="Foreground" Value="#3CB371" />
- </DataTrigger>
- <DataTrigger Binding="{Binding RecipeStatus}" Value="2">
- <Setter TargetName="txState" Property="Foreground" Value="Aqua" />
- </DataTrigger>
- <MultiTrigger>
- <MultiTrigger.Conditions>
- <Condition Property="IsMouseOver" Value="True" />
- <Condition Property="IsEnabled" Value="True" />
- </MultiTrigger.Conditions>
- <Setter TargetName="txState" Property="FontSize" Value="17 " />
- </MultiTrigger>
- </ControlTemplate.Triggers>
- </ControlTemplate>
-
- </Setter.Value>
- </Setter>
- <Style.Triggers />
-
- </Style>
-
- <DataTemplate x:Key="TreeItemTemplate" DataType="TreeViewItem">
- <Grid Height="28" Margin="50,0,0,0">
- <Grid.ColumnDefinitions>
- <ColumnDefinition Width="*" />
- <ColumnDefinition Width="*" />
- </Grid.ColumnDefinitions>
- <TextBlock
- Margin="10,0"
- HorizontalAlignment="Left"
- VerticalAlignment="Center"
- FontSize="15"
- Foreground="#aa2AB2E7"
- Text="原料:" />
- <TextBlock
- Grid.Column="1"
- Margin="10,0"
- HorizontalAlignment="Left"
- VerticalAlignment="Center"
- FontSize="15"
- Foreground="#aa2AB2E7"
- Text="{Binding RawMaterialName}" />
- </Grid>
- </DataTemplate>
-
- <Style x:Key="recipeTreeItem" TargetType="TreeViewItem">
- <Setter Property="Background" Value="Transparent" />
- <Setter Property="BorderThickness" Value="0" />
- <Setter Property="IsExpanded" Value="True" />
- <Setter Property="HeaderTemplate">
- <Setter.Value>
- <HierarchicalDataTemplate ItemTemplate="{StaticResource TreeItemTemplate}" ItemsSource="{Binding RawMaterials, Mode=TwoWay}">
- <StackPanel
- Height="28"
- HorizontalAlignment="Left"
- VerticalAlignment="Center"
- Orientation="Horizontal">
- <TextBlock
- Margin="5,0,0,0"
- VerticalAlignment="Center"
- FontSize="15"
- Foreground="#FF2AB2E7"
- Text="配方:" />
- <TextBlock
- Margin="5,0,0,0"
- VerticalAlignment="Center"
- FontSize="15"
- Foreground="#FF2AB2E7"
- Text="{Binding RecipeName}" />
- </StackPanel>
- </HierarchicalDataTemplate>
- </Setter.Value>
- </Setter>
- <Setter Property="Template">
- <Setter.Value>
- <ControlTemplate TargetType="{x:Type TreeViewItem}">
- <Grid>
- <Grid.ColumnDefinitions>
- <ColumnDefinition Width="Auto" />
- <ColumnDefinition Width="*" />
- </Grid.ColumnDefinitions>
- <Grid.RowDefinitions>
- <RowDefinition Height="Auto" />
- <RowDefinition />
- </Grid.RowDefinitions>
- <Border
- x:Name="Bd"
- Grid.Column="0"
- Padding="{TemplateBinding Padding}"
- Background="{TemplateBinding Background}"
- BorderBrush="{TemplateBinding BorderBrush}"
- BorderThickness="{TemplateBinding BorderThickness}">
- <ContentPresenter
- x:Name="PART_Header"
- HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
- ContentSource="Header" />
- </Border>
- <ItemsPresenter
- x:Name="ItemsHost"
- Grid.Row="1"
- Grid.Column="0"
- Grid.ColumnSpan="2"
- Visibility="Collapsed" />
- <VisualStateManager.VisualStateGroups>
- <VisualStateGroup x:Name="SelectionStates">
- <VisualState x:Name="Selected">
- <Storyboard>
- <ColorAnimationUsingKeyFrames Storyboard.TargetName="Bd" Storyboard.TargetProperty="(Panel.Background).(SolidColorBrush.Color)">
- <EasingColorKeyFrame KeyTime="0" Value="Transparent" />
- </ColorAnimationUsingKeyFrames>
- </Storyboard>
- </VisualState>
-
- <VisualState x:Name="Unselected" />
- <VisualState x:Name="SelectedInactive">
- <Storyboard>
- <ColorAnimationUsingKeyFrames Storyboard.TargetName="Bd" Storyboard.TargetProperty="(Panel.Background).(SolidColorBrush.Color)">
- <EasingColorKeyFrame KeyTime="0" Value="Transparent" />
- </ColorAnimationUsingKeyFrames>
- </Storyboard>
- </VisualState>
- </VisualStateGroup>
- <VisualStateGroup x:Name="ExpansionStates">
- <VisualState x:Name="Expanded">
- <Storyboard>
- <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ItemsHost" Storyboard.TargetProperty="(UIElement.Visibility)">
- <DiscreteObjectKeyFrame KeyTime="0" Value="{x:Static Visibility.Visible}" />
- </ObjectAnimationUsingKeyFrames>
- </Storyboard>
- </VisualState>
- <VisualState x:Name="Collapsed" />
- </VisualStateGroup>
- </VisualStateManager.VisualStateGroups>
- </Grid>
- <ControlTemplate.Triggers>
- <MultiTrigger>
- <MultiTrigger.Conditions>
- <Condition Property="HasHeader" Value="false" />
- <Condition Property="Width" Value="Auto" />
- </MultiTrigger.Conditions>
- <Setter TargetName="PART_Header" Property="MinWidth" Value="75" />
- </MultiTrigger>
- <MultiTrigger>
- <MultiTrigger.Conditions>
- <Condition Property="HasHeader" Value="false" />
- <Condition Property="Height" Value="Auto" />
- </MultiTrigger.Conditions>
- <Setter TargetName="PART_Header" Property="MinHeight" Value="19" />
- </MultiTrigger>
- </ControlTemplate.Triggers>
- </ControlTemplate>
- </Setter.Value>
- </Setter>
- </Style>
-
- <!--#region 下拉列表样式-->
- <Style x:Key="ToggleButtonStyle" TargetType="{x:Type ToggleButton}">
- <Setter Property="FocusVisualStyle" Value="{x:Null}" />
- <!--<Setter Property="Height" Value="10" />-->
- <Setter Property="HorizontalContentAlignment" Value="Left" />
- <Setter Property="VerticalContentAlignment" Value="Top" />
- <Setter Property="Padding" Value="10,10" />
- <Setter Property="Template">
- <Setter.Value>
- <ControlTemplate TargetType="{x:Type ToggleButton}">
- <Grid>
- <Border
- x:Name="border2"
- Width="auto"
- Margin="{TemplateBinding Padding}"
- HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
- VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
- Background="{TemplateBinding Background}">
- <ContentPresenter
- Margin="{TemplateBinding Padding}"
- HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
- VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
- RecognizesAccessKey="True"
- SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
- </Border>
- </Grid>
-
- <ControlTemplate.Triggers>
- <Trigger Property="IsMouseOver" Value="True">
- <Setter TargetName="border2" Property="Background" Value="#191E36" />
- </Trigger>
- <Trigger Property="IsMouseOver" Value="False">
- <Setter TargetName="border2" Property="Background" Value="Transparent" />
- </Trigger>
- </ControlTemplate.Triggers>
- </ControlTemplate>
- </Setter.Value>
- </Setter>
- </Style>
-
- <Style x:Key="ExpanderStyle" TargetType="{x:Type Expander}">
- <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}" />
- <Setter Property="HorizontalContentAlignment" Value="Stretch" />
- <Setter Property="VerticalContentAlignment" Value="Stretch" />
- <Setter Property="BorderBrush" Value="Transparent" />
- <Setter Property="BorderThickness" Value="1" />
-
- <Setter Property="Template">
- <Setter.Value>
- <ControlTemplate TargetType="{x:Type Expander}">
- <DockPanel>
- <ToggleButton
- x:Name="HeaderSite"
- Height="20"
- Width="auto"
- MinWidth="0"
- MinHeight="0"
- Margin="1"
- Padding="{TemplateBinding Padding}"
- Background="Transparent"
- HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}"
- VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}"
- Content="{TemplateBinding Header}"
- ContentTemplate="{TemplateBinding HeaderTemplate}"
- ContentTemplateSelector="{TemplateBinding HeaderTemplateSelector}"
- DockPanel.Dock="Top"
- FontFamily="{TemplateBinding FontFamily}"
- FontSize="{TemplateBinding FontSize}"
- FontStretch="{TemplateBinding FontStretch}"
- FontStyle="{TemplateBinding FontStyle}"
- FontWeight="{TemplateBinding FontWeight}"
- Foreground="{TemplateBinding Foreground}"
- IsChecked="{Binding IsExpanded, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}"
- Style="{StaticResource ToggleButtonStyle}" />
- <ContentPresenter
- x:Name="ExpandSite"
- Margin="{TemplateBinding Padding}"
- HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
- VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
- DockPanel.Dock="Left"
- Focusable="false"
- Visibility="Visible" />
- </DockPanel>
- <ControlTemplate.Triggers>
- <Trigger Property="IsExpanded" Value="True">
- <Setter TargetName="ExpandSite" Property="Visibility" Value="Collapsed" />
- </Trigger>
- </ControlTemplate.Triggers>
- </ControlTemplate>
- </Setter.Value>
- </Setter>
- </Style>
- <!--#endregion-->
- </UserControl.Resources>
- <Grid Margin="20">
-
- <Grid.ColumnDefinitions>
- <ColumnDefinition />
- <!--<ColumnDefinition Width="0.25*" />-->
- </Grid.ColumnDefinitions>
-
- <Grid Name="ggr" Margin="10">
-
- <pry:ImageBorder Width="{Binding ElementName=ggr, Path=ActualWidth}" Height="{Binding ElementName=ggr, Path=ActualHeight}" />
-
- <ListBox
- Margin="5"
- VerticalAlignment="Top"
- Background="Transparent"
- BorderThickness="0"
- ItemsSource="{Binding Recipes}"
- ScrollViewer.HorizontalScrollBarVisibility="Disabled">
- <ListBox.ItemsPanel>
- <ItemsPanelTemplate>
- <UniformGrid
- HorizontalAlignment="Left"
- VerticalAlignment="Top"
- Columns="6" />
- </ItemsPanelTemplate>
- </ListBox.ItemsPanel>
-
- <ListBox.ItemTemplate>
- <DataTemplate>
- <Grid
- Name="tt"
- Height="300"
- Margin="5">
- <Grid.RowDefinitions>
- <RowDefinition Height="80" />
- <RowDefinition Height="20" />
- <RowDefinition Height="198" />
- <RowDefinition Height="2" />
- </Grid.RowDefinitions>
-
- <Image
- Grid.RowSpan="5"
- Source="/BPASmartClient.CustomResource;component/Image/配方背景/竖背景框.png"
- Stretch="Fill" />
- <Grid Grid.Row="0">
-
- <Grid.RowDefinitions>
- <RowDefinition></RowDefinition>
- <RowDefinition></RowDefinition>
- <RowDefinition></RowDefinition>
- </Grid.RowDefinitions>
- <Grid.ColumnDefinitions>
- <ColumnDefinition Width="3*"></ColumnDefinition>
- <ColumnDefinition Width="7*"></ColumnDefinition>
- </Grid.ColumnDefinitions>
-
- <TextBlock
- Grid.Row="0"
- Grid.Column="0"
- Margin="7,5,0,0"
- HorizontalAlignment="left"
- VerticalAlignment="Center"
- FontSize="16"
- Foreground="#FF2AB2E7"
- Text="配方名称:"></TextBlock>
- <TextBlock
- Grid.Row="0"
- Grid.Column="1"
- Margin="7,5,0,0"
- HorizontalAlignment="left"
- VerticalAlignment="Center"
- FontSize="16"
- Foreground="#FF2AB2E7"
- Text="{Binding RecipeName}" />
- <TextBlock
- Grid.Row="1"
- Grid.Column="0"
- Margin="7,5,0,0"
- HorizontalAlignment="left"
- VerticalAlignment="Center"
- FontSize="16"
- Foreground="#FF2AB2E7"
- Text="配方编号:"></TextBlock>
- <TextBlock
- Grid.Row="1"
- Grid.Column="1"
- Margin="7,5,0,0"
- HorizontalAlignment="left"
- VerticalAlignment="Center"
- FontSize="16"
- Foreground="#FF2AB2E7"
- Text="{Binding RecipeCode}" />
- <TextBlock
- Grid.Row="2"
- Grid.Column="0"
- Margin="7,5,0,0"
- HorizontalAlignment="left"
- VerticalAlignment="Center"
- FontSize="16"
- Foreground="#FF2AB2E7"
- Text="托盘编号:"></TextBlock>
- <TextBlock
- Grid.Row="2"
- Grid.Column="1"
- Margin="7,5,0,0"
- HorizontalAlignment="left"
- VerticalAlignment="Center"
- FontSize="16"
- Foreground="#FF2AB2E7"
- Text="{Binding TrayCode}" />
- </Grid>
-
-
- <TextBlock
- Grid.Row="1"
- FontSize="16"
- Margin="7,2,0,0"
- VerticalAlignment="Top"
- Foreground="#FF2AB2E7"
- Text="原料信息:" />
-
- <ScrollViewer
- Grid.Row="2"
- VerticalAlignment="Top"
- Background="Transparent"
- HorizontalScrollBarVisibility="Hidden"
- VerticalScrollBarVisibility="Visible">
- <ItemsControl ItemsSource="{Binding RawMaterial}">
- <ItemsControl.ItemsPanel>
- <ItemsPanelTemplate>
- <StackPanel/>
- </ItemsPanelTemplate>
- </ItemsControl.ItemsPanel>
- <ItemsControl.ItemTemplate>
- <DataTemplate>
- <Expander Style="{StaticResource ExpanderStyle}" Margin="40,0,0,0">
- <Expander.Header>
- <StackPanel Orientation="Horizontal">
- <Border Width="15" Height="15" CornerRadius="15" HorizontalAlignment="Left" Margin="0,0,5,0">
- <Border.Background>
- <RadialGradientBrush>
- <GradientStop Color="#FF2AB2E7" Offset="0.5" />
- <GradientStop Color="White"/>
- </RadialGradientBrush>
- </Border.Background>
- </Border>
- <TextBlock Text="{Binding RawMaterialName }" Foreground="#FF2AB2E7" VerticalAlignment="Center" FontSize="14"/>
- </StackPanel>
- </Expander.Header>
- <Expander.Content>
- <StackPanel Margin="36,0,0,0">
- <StackPanel Orientation="Horizontal">
- <TextBlock Text="原料桶号:" Foreground="#FF2AB2E7"/>
- <TextBlock Text="{Binding RawMaterialBarrelNum}" Foreground="#FF2AB2E7"/>
- </StackPanel>
- <StackPanel Orientation="Horizontal">
- <TextBlock Text="原料重量:" Foreground="#FF2AB2E7"/>
- <TextBlock Text="{Binding RawMaterialWeight}" Foreground="#FF2AB2E7"/>
- </StackPanel>
- </StackPanel>
- </Expander.Content>
- </Expander>
- </DataTemplate>
- </ItemsControl.ItemTemplate>
- </ItemsControl>
- </ScrollViewer>
- <Image
- Grid.Row="3"
- Width="{Binding ElementName=tt, Path=ActualWidth}"
- Height="2"
- VerticalAlignment="Bottom"
- Source="/BPASmartClient.CustomResource;component/Image/直线.png"
- Stretch="Fill" />
- </Grid>
- </DataTemplate>
- </ListBox.ItemTemplate>
- </ListBox>
- </Grid>
- </Grid>
- </UserControl>
|