<Style TargetType="{x:Type ContextMenu}">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type ContextMenu}">
<Border x:Name="Border" CornerRadius="4" Background="#A5181818" BorderThickness="2">
<Border.BorderBrush>
<SolidColorBrush Color="#BABABA" />
</Border.BorderBrush>
<ItemsPresenter/>
</Border>
<ControlTemplate.Triggers>
<MultiTrigger>
<MultiTrigger.Conditions>
<Condition Property="IsMouseOver" Value="True"/>
</MultiTrigger.Conditions>
<MultiTrigger.EnterActions>
<BeginStoryboard>
<Storyboard>
<DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetProperty="(FrameworkElement.Width)">
<SplineDoubleKeyFrame KeyTime="00:00:00.0020000" Value="0"/>
<SplineDoubleKeyFrame KeyTime="00:00:00.3450000" Value="95"/>
</DoubleAnimationUsingKeyFrames>
<DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetProperty="(FrameworkElement.Height)">
<SplineDoubleKeyFrame KeyTime="00:00:00.0020000" Value="0"/>
<SplineDoubleKeyFrame KeyTime="00:00:00.3450000" Value="54"/>
</DoubleAnimationUsingKeyFrames>
</Storyboard>
</BeginStoryboard>
</MultiTrigger.EnterActions>
</MultiTrigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<Style TargetType="{x:Type MenuItem}">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type MenuItem}">
<Border Margin="1" MinWidth="80" CornerRadius="5">
<Border.Background>
<SolidColorBrush x:Name="MyAnimatedBrushBackground" Color="Transparent" />
</Border.Background>
<StackPanel Orientation="Horizontal">
<TextBlock Text=" "/>
<ContentPresenter ContentSource="Icon" HorizontalAlignment="Center" VerticalAlignment="Center" />
<TextBlock Text=" "/>
<ContentPresenter ContentSource="Header" HorizontalAlignment="Center" VerticalAlignment="Center"/>
</StackPanel>
</Border>
<ControlTemplate.Triggers>
<MultiTrigger>
<MultiTrigger.Conditions>
<Condition Property="IsMouseOver" Value="True"/>
</MultiTrigger.Conditions>
<MultiTrigger.EnterActions>
<BeginStoryboard>
<Storyboard>
<ColorAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="MyAnimatedBrushBackground" Storyboard.TargetProperty="Color">
<LinearColorKeyFrame Value="Transparent" KeyTime="00:00:00.0020000" />
<LinearColorKeyFrame Value="#7E9C9C9C" KeyTime="00:00:00.0320000" />
</ColorAnimationUsingKeyFrames>
</Storyboard>
</BeginStoryboard>
</MultiTrigger.EnterActions>
<MultiTrigger.ExitActions>
<BeginStoryboard>
<Storyboard>
<ColorAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="MyAnimatedBrushBackground" Storyboard.TargetProperty="Color">
<LinearColorKeyFrame Value="#7E9C9C9C" KeyTime="00:00:00.0020000" />
<LinearColorKeyFrame Value="Transparent" KeyTime="00:00:00.0320000" />
</ColorAnimationUsingKeyFrames>
</Storyboard>
</BeginStoryboard>
</MultiTrigger.ExitActions>
</MultiTrigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<MenuItem Name="menuLook" Foreground="Black" Height="25">
<MenuItem.Icon>
<Image Width="21" Height="21" Source="search.png"></Image>
</MenuItem.Icon>
<MenuItem.Header>
<TextBlock Text="查看图片" Height="21"/>
</MenuItem.Header>
</MenuItem>
<MenuItem Name="menuEdit" Foreground="Black" Height="25">
<MenuItem.Icon>
<Image Width="21" Height="21" Source="tools.png"></Image>
</MenuItem.Icon>
<MenuItem.Header>
<TextBlock Text="图片增强" Height="21"/>
</MenuItem.Header>
</MenuItem>
</ContextMenu>