|
- <UserControl x:Class="BPASmart.RecipeManagement.View.MaterialManager"
- 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:MaterialManagerViewModel/>
- </UserControl.DataContext>
- <UserControl.Resources>
-
- <Style TargetType="ListViewItem" >
- <Setter Property="Margin" Value="60,20"/>
- <Setter Property="Template">
- <Setter.Value>
- <ControlTemplate TargetType="ListViewItem">
- <Border Padding="4" Opacity="0.7" x:Name="mborder" BorderBrush="Transparent" BorderThickness="1">
-
- <Border >
- <Border.Background>
- <ImageBrush ImageSource="../image/蓝边框.png"/>
- </Border.Background>
- <Grid Width="100" >
-
- <Grid.RowDefinitions>
- <RowDefinition Height="60"/>
- <RowDefinition Height="25"/>
- <RowDefinition Height="5"/>
- </Grid.RowDefinitions>
- <Grid.ColumnDefinitions>
- <ColumnDefinition Width="*"/>
- <ColumnDefinition Width="*"/>
- </Grid.ColumnDefinitions>
- <TextBlock Text="{Binding MaterialPosion}" Foreground="White" Height="20" Width="20" VerticalAlignment="Top" HorizontalAlignment="Left" Margin="10,0"/>
- <TextBlock Text="{Binding Name}" Grid.ColumnSpan="2" Foreground="Orange"
- FontSize="24"
- HorizontalAlignment="Center" VerticalAlignment="Center"></TextBlock>
- <TextBlock Grid.Row="1" Text="种类:" Foreground="#FF2AB2E7" FontSize="16" VerticalAlignment="Center" HorizontalAlignment="Right"/>
- <TextBlock Grid.Row="1" Grid.Column="1" FontSize="16"
- VerticalAlignment="Center" HorizontalAlignment="Left" Foreground="#FF2AB2E7"
- Text="{Binding MaterialType}" TextAlignment="Center"></TextBlock>
-
-
- </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 Background="Transparent">
- <Grid.ColumnDefinitions>
- <ColumnDefinition />
- </Grid.ColumnDefinitions>
- <Grid.RowDefinitions>
- <RowDefinition Height="*"/>
- <RowDefinition Height="20*"/>
- <RowDefinition Height="20*"/>
- </Grid.RowDefinitions>
- <Grid Grid.RowSpan="2" Grid.Row="1">
- <Grid.RowDefinitions>
- <RowDefinition Height="40"/>
- <RowDefinition Height="30"/>
- <RowDefinition Height="*"/>
- </Grid.RowDefinitions>
- <TextBlock Text="原料清单" FontSize="28" VerticalAlignment="Center" HorizontalAlignment="Center"/>
- <Button Grid.Row="1" x:Name="MateraisProperty" Style="{DynamicResource CommonButton}" Content="原料扩展属性"
- VerticalAlignment="Center" HorizontalAlignment="Right"
- FontSize="14" Margin="0,0,20,0" Height="26" Width="120"
- Click="MateraisProperty_Click"/>
- <ListView x:Name="mylistview" Grid.Row="2"
- ScrollViewer.HorizontalScrollBarVisibility="Disabled" ItemsSource="{Binding MaterialList}" Margin=" 0" Background="Transparent"
- BorderBrush="Transparent">
-
- <ListView.ContextMenu>
- <ContextMenu FontSize="16" Foreground="White">
- <MenuItem Name="MenuAdd" Command="{Binding CreateMaterailCommand}">
- <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 EditMaterailCommand }"
- 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 Name="MenuDelete"
- Command="{Binding DeleteMaterailCommand}"
- 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>
- </Grid>
- </Border>
- </UserControl>
|