Files
Shrlalgo.RvKits/WPFluent/Controls/ContextMenu/ContextMenu.xaml

70 lines
3.6 KiB
XML

<!--
This Source Code Form is subject to the terms of the MIT License.
If a copy of the MIT was not distributed with this file, You can obtain one at https://opensource.org/licenses/MIT.
Copyright (C) Leszek Pomianowski and WPF UI Contributors.
All Rights Reserved.
-->
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<Style x:Key="UiContextMenu" TargetType="{x:Type ContextMenu}">
<Setter Property="TextElement.Foreground" Value="{DynamicResource ContextMenuForeground}" />
<Setter Property="Foreground" Value="{DynamicResource ContextMenuForeground}" />
<Setter Property="Background" Value="{DynamicResource ContextMenuBackground}" />
<Setter Property="BorderBrush" Value="{DynamicResource ContextMenuBorderBrush}" />
<Setter Property="MinWidth" Value="140" />
<Setter Property="Padding" Value="0" />
<Setter Property="Margin" Value="0" />
<Setter Property="HasDropShadow" Value="False" />
<Setter Property="Grid.IsSharedSizeScope" Value="True" />
<Setter Property="Popup.PopupAnimation" Value="None" />
<Setter Property="SnapsToDevicePixels" Value="True" />
<Setter Property="OverridesDefaultStyle" Value="True" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type ContextMenu}">
<Border
x:Name="Border"
Padding="0,3,0,3"
Background="{TemplateBinding Background}"
BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="1"
CornerRadius="8">
<Border.RenderTransform>
<TranslateTransform />
</Border.RenderTransform>
<StackPanel
ClipToBounds="True"
IsItemsHost="True"
KeyboardNavigation.DirectionalNavigation="Cycle"
Orientation="Vertical" />
</Border>
<ControlTemplate.Triggers>
<Trigger Property="IsOpen" Value="True">
<Trigger.EnterActions>
<BeginStoryboard>
<Storyboard>
<DoubleAnimation
Storyboard.TargetName="Border"
Storyboard.TargetProperty="(Border.RenderTransform).(TranslateTransform.Y)"
From="-90"
To="0"
Duration="00:00:00.167">
<DoubleAnimation.EasingFunction>
<CircleEase EasingMode="EaseOut" />
</DoubleAnimation.EasingFunction>
</DoubleAnimation>
</Storyboard>
</BeginStoryboard>
</Trigger.EnterActions>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<Style BasedOn="{StaticResource UiContextMenu}" TargetType="{x:Type ContextMenu}" />
</ResourceDictionary>