|
- <UserControl x:Class="BPASmart.RecipeManagement.View.RecipeManager"
- 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:BPASmart.RecipeManagement.View"
- xmlns:vm="clr-namespace:BPASmart.RecipeManagement.ViewModel"
- mc:Ignorable="d"
- d:DesignHeight="450" d:DesignWidth="800" Foreground="#FF2AB2E7">
- <UserControl.DataContext>
- <vm:RecipeManagerViewModel/>
- </UserControl.DataContext>
- <UserControl.Resources>
- <Style TargetType="ListViewItem" >
- <Setter Property="Margin" Value="10"/>
-
- <Setter Property="Template">
- <Setter.Value>
- <ControlTemplate TargetType="ListViewItem">
- <Border x:Name="mborder" BorderThickness="1" Background="Transparent"
- Opacity="0.6" Margin="10" Padding="2"
- >
-
- <Border Margin="4">
- <Border.Background>
- <ImageBrush ImageSource="../image/外边框1.png" />
- </Border.Background>
- <Grid
- Name="tt"
- Height="200"
- Width="150"
- Margin="5">
- <Grid.RowDefinitions>
- <RowDefinition Height="30" />
- <RowDefinition Height="20" />
- <RowDefinition Height="128" />
- <RowDefinition Height="2" />
- <RowDefinition Height="40" />
- </Grid.RowDefinitions>
- <TextBlock
- Grid.Row="0"
- Margin="2,5,0,0"
- HorizontalAlignment="Center"
- VerticalAlignment="Top"
- FontSize="18"
- Foreground="Orange"
- Text="{Binding Name}" />
-
- <TextBlock
- Grid.Row="1"
- Margin="5,0,0,0"
- VerticalAlignment="Top"
- Foreground="White"
- Text="配方信息:" />
-
- <ScrollViewer
- Grid.Row="2"
- VerticalAlignment="Top"
- Background="Transparent"
- HorizontalScrollBarVisibility="Hidden"
- VerticalScrollBarVisibility="Hidden">
- <Grid>
- <Grid.ColumnDefinitions>
- <ColumnDefinition Width="auto" />
- <ColumnDefinition />
- </Grid.ColumnDefinitions>
-
- <ItemsControl ItemsSource="{Binding recipeMaterials}">
- <ItemsControl.ItemTemplate>
- <DataTemplate>
- <Grid>
- <TextBlock
- Grid.Row="1"
- Margin="5,0,0,0"
- HorizontalAlignment="Right"
- VerticalAlignment="Center"
- Foreground="#FF2AB2E7"
- Text="{Binding Name}" />
- </Grid>
- </DataTemplate>
- </ItemsControl.ItemTemplate>
- </ItemsControl>
-
- <ItemsControl Grid.Column="1"
- VerticalAlignment="Center"
- VerticalContentAlignment="Center" ItemsSource="{Binding recipeMaterials}">
- <ItemsControl.ItemTemplate>
- <DataTemplate>
- <StackPanel Orientation="Horizontal">
-
- <TextBlock
- Margin="5,0,0,0"
- HorizontalAlignment="Center"
- VerticalAlignment="Center"
- Foreground="#FF2AB2E7"
- Text=":" />
-
- <TextBlock
- Margin="5,0,0,0"
- HorizontalAlignment="Center"
- VerticalAlignment="Center"
- Foreground="#FF2AB2E7"
- Text="{Binding MaterialWeight}" />
-
- <TextBlock
- Margin="5,0,0,0"
- HorizontalAlignment="Center"
- VerticalAlignment="Center"
- Foreground="#FF2AB2E7"
- Text="g" />
-
- </StackPanel>
- </DataTemplate>
- </ItemsControl.ItemTemplate>
- </ItemsControl>
-
- </Grid>
-
- </ScrollViewer>
- <Button Grid.Row="4" Content="配方下发" Style="{DynamicResource GreenButton}" BorderBrush="Green" BorderThickness="1"
- Height="20" Width="70" HorizontalAlignment="Left" VerticalAlignment="Top" Margin="0,0,5,0"
- Command="{Binding RelativeSource={RelativeSource AncestorType=UserControl,Mode=FindAncestor},Path=DataContext.PecipeStartCommand}"
- CommandParameter="{Binding ID}"/>
- <Button Grid.Row="4" Content="配方工艺" Style="{DynamicResource ButtonStyle}"
- Height="20" Width="70" HorizontalAlignment="Right" VerticalAlignment="Top" Margin="5,0,0,0"
- Command="{Binding RelativeSource={RelativeSource AncestorType=UserControl,Mode=FindAncestor},Path=DataContext.PecipeSettingCommand}"
- CommandParameter="{Binding ID}"/>
- </Grid>
- </Border>
-
- </Border>
- <ControlTemplate.Triggers>
- <Trigger Property="IsMouseOver" Value="True">
- <Setter Property="BorderBrush" Value="#4169E1" TargetName="mborder"/>
- <Setter Property="Opacity" Value="1" TargetName="mborder"/>
- </Trigger>
- <Trigger Property="IsFocused" Value="True">
-
- </Trigger>
- </ControlTemplate.Triggers>
- </ControlTemplate>
- </Setter.Value>
- </Setter>
- </Style>
-
- </UserControl.Resources>
- <Border>
- <Border.Background>
- <ImageBrush ImageSource="../image/中间.png"/>
- </Border.Background>
- <Grid>
- <Grid.RowDefinitions>
- <RowDefinition Height="17"/>
- <RowDefinition Height="40"/>
- <RowDefinition Height="25"/>
- <RowDefinition />
- </Grid.RowDefinitions>
- <TextBlock Grid.Row="1" Text="配方清单" FontSize="28" VerticalAlignment="Center" HorizontalAlignment="Center"/>
-
- <Button Grid.Row="2" Content="工艺流程" Style="{DynamicResource CommonButton}" HorizontalAlignment="Right" Margin="20,0" Width="100"/>
- <ListView Grid.Row="3"
- ScrollViewer.HorizontalScrollBarVisibility="Disabled" ItemsSource="{Binding RecipeList}" Margin=" 10" Background="Transparent"
- BorderBrush="Transparent">
-
- <ListView.ContextMenu>
- <ContextMenu FontSize="16" Foreground="White">
- <MenuItem Command="{Binding CreateRecipeCommand}">
- <MenuItem.Header>
- <Grid>
- <Grid.ColumnDefinitions>
- <ColumnDefinition Width="auto"/>
- <ColumnDefinition Width="*"/>
- </Grid.ColumnDefinitions>
- <TextBlock Style="{DynamicResource menuText}" Text=""/>
- <TextBlock Grid.Column="1" Text="新建配方" Style="{DynamicResource menuText}" FontFamily="楷体"/>
- </Grid>
- </MenuItem.Header>
- </MenuItem>
- <MenuItem Command="{Binding EditRecipeCommand }"
- CommandParameter="{Binding PlacementTarget.SelectedIndex,RelativeSource={RelativeSource AncestorType=ContextMenu}}">
- <MenuItem.Header>
- <Grid>
- <Grid.ColumnDefinitions>
- <ColumnDefinition Width="auto"/>
- <ColumnDefinition Width="*"/>
- </Grid.ColumnDefinitions>
- <TextBlock Style="{DynamicResource menuText}" Text="󰈓"/>
- <TextBlock Grid.Column="1" Text="编辑配方" Style="{DynamicResource menuText}" FontFamily="楷体" />
- </Grid>
- </MenuItem.Header>
- </MenuItem>
- <MenuItem Command="{Binding DeleteRecipeCommand}"
- CommandParameter="{Binding PlacementTarget.SelectedIndex,RelativeSource={RelativeSource AncestorType=ContextMenu}}">
- <MenuItem.Header>
- <Grid>
- <Grid.ColumnDefinitions>
- <ColumnDefinition Width="auto"/>
- <ColumnDefinition Width="*"/>
- </Grid.ColumnDefinitions>
- <TextBlock Style="{DynamicResource menuText}" Text=""/>
- <TextBlock Grid.Column="1" Text="删除配方" Style="{DynamicResource menuText}" FontFamily="楷体" />
- </Grid>
- </MenuItem.Header>
- </MenuItem>
- </ContextMenu>
- </ListView.ContextMenu>
- <ListBox.ItemsPanel>
- <ItemsPanelTemplate>
- <WrapPanel Margin="10"/>
- </ItemsPanelTemplate>
- </ListBox.ItemsPanel>
- </ListView>
- </Grid>
- </Border>
- </UserControl>
|