Files
ShrlAlgoToolkit/Melskin/Controls/TextBoxContextMenu.xaml

63 lines
2.9 KiB
Plaintext
Raw Permalink Normal View History

<ResourceDictionary
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
2026-02-20 15:31:44 +08:00
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:controls="clr-namespace:Melskin.Controls">
2025-07-31 20:12:24 +08:00
2026-02-20 15:31:44 +08:00
<Style x:Key="DefaultTextBoxContextMenuStyle" TargetType="{x:Type ContextMenu}">
2025-07-31 20:12:24 +08:00
<Setter Property="FontSize" Value="14" />
<Setter Property="Padding" Value="2,0" />
2025-08-12 23:08:54 +08:00
<Setter Property="Foreground" Value="{DynamicResource TextPrimaryBrush}" />
<Setter Property="Background" Value="{DynamicResource BackgroundLayoutBrush}" />
<Setter Property="BorderBrush" Value="{DynamicResource BorderGradientBrush}" />
2025-07-31 20:12:24 +08:00
<Setter Property="BorderThickness" Value="1" />
<Setter Property="SnapsToDevicePixels" Value="True" />
<Setter Property="OverridesDefaultStyle" Value="True" />
<Setter Property="Grid.IsSharedSizeScope" Value="true" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type ContextMenu}">
<Grid>
<Border
2026-02-20 15:31:44 +08:00
x:Name="Border"
Margin="8"
Padding="0"
2025-08-12 23:08:54 +08:00
Background="{TemplateBinding Background}"
BorderThickness="0"
CornerRadius="4"
2026-02-20 15:31:44 +08:00
Effect="{DynamicResource PopupShadow}">
2025-07-31 20:12:24 +08:00
<StackPanel
2026-02-20 15:31:44 +08:00
Margin="2,1"
2025-08-12 23:08:54 +08:00
IsItemsHost="True"
2026-02-20 15:31:44 +08:00
KeyboardNavigation.DirectionalNavigation="Cycle" />
2025-07-31 20:12:24 +08:00
</Border>
<Rectangle
2025-08-12 23:08:54 +08:00
Margin="8"
RadiusX="4"
RadiusY="4"
Stroke="{TemplateBinding BorderBrush}"
StrokeThickness="{TemplateBinding BorderThickness}" />
2025-07-31 20:12:24 +08:00
</Grid>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
2026-02-20 15:31:44 +08:00
<ContextMenu x:Key="TextBoxContextMenu" Style="{StaticResource DefaultTextBoxContextMenuStyle}">
2025-07-31 20:12:24 +08:00
<MenuItem Command="ApplicationCommands.Copy">
<MenuItem.Icon>
2025-10-10 11:19:58 +08:00
<controls:IconElement Foreground="{DynamicResource TextPrimaryBrush}" Symbol="ContentCopy" />
2025-07-31 20:12:24 +08:00
</MenuItem.Icon>
</MenuItem>
<MenuItem Command="ApplicationCommands.Cut">
<MenuItem.Icon>
2025-10-10 11:19:58 +08:00
<controls:IconElement Foreground="{DynamicResource TextPrimaryBrush}" Symbol="ContentCut" />
2025-07-31 20:12:24 +08:00
</MenuItem.Icon>
</MenuItem>
<MenuItem Command="ApplicationCommands.Paste">
<MenuItem.Icon>
2025-10-10 11:19:58 +08:00
<controls:IconElement Foreground="{DynamicResource TextPrimaryBrush}" Symbol="ContentPaste" />
2025-07-31 20:12:24 +08:00
</MenuItem.Icon>
</MenuItem>
</ContextMenu>
</ResourceDictionary>