Files
aistudio-wpf-diagram/Extensions/AIStudio.Wpf.Mind/Styles/ContextMenu.xaml
2023-04-16 20:11:40 +08:00

61 lines
3.4 KiB
XML

<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:options="http://schemas.microsoft.com/winfx/2006/xaml/presentation/options">
<DropShadowEffect x:Key="DropShadowEffectStyle"
x:Shared="False"
BlurRadius="4"
Direction="315"
Opacity="0.3"
ShadowDepth="2"
Color="Black"
options:Freeze="True" />
<Style x:Key="ContextMenuStyle" TargetType="{x:Type ContextMenu}">
<Setter Property="Background" Value="White" />
<Setter Property="Block.TextAlignment" Value="Left" />
<Setter Property="BorderBrush" Value="LightGray" />
<Setter Property="BorderThickness" Value="1" />
<Setter Property="Foreground" Value="Black" />
<Setter Property="Grid.IsSharedSizeScope" Value="True" />
<Setter Property="HasDropShadow" Value="True" />
<Setter Property="HorizontalContentAlignment" Value="Left" />
<Setter Property="OverridesDefaultStyle" Value="True" />
<Setter Property="RenderOptions.ClearTypeHint" Value="Enabled" />
<Setter Property="SnapsToDevicePixels" Value="True" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type ContextMenu}">
<Border x:Name="Border"
Width="{TemplateBinding Width}"
Height="{TemplateBinding Height}"
Padding="{TemplateBinding Padding}"
Background="{TemplateBinding Background}"
BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}"
CornerRadius="3"
SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}">
<ScrollViewer x:Name="SubMenuScrollViewer"
CanContentScroll="True">
<ItemsPresenter x:Name="ItemsPresenter"
Margin="0"
Grid.IsSharedSizeScope="True"
KeyboardNavigation.DirectionalNavigation="Cycle"
KeyboardNavigation.TabNavigation="Cycle"
SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
</ScrollViewer>
</Border>
<ControlTemplate.Triggers>
<Trigger Property="HasDropShadow" Value="True">
<Setter TargetName="Border" Property="Effect" Value="{StaticResource DropShadowEffectStyle}" />
<Setter TargetName="Border" Property="Margin" Value="0 0 6 6" />
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
<Setter Property="TextOptions.TextFormattingMode" Value="Ideal" />
<Setter Property="VerticalContentAlignment" Value="Center" />
</Style>
</ResourceDictionary>