You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
75 lines
3.6 KiB
75 lines
3.6 KiB
1 year ago
|
<ResourceDictionary
|
||
|
xmlns="https://github.com/avaloniaui"
|
||
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
|
||
|
|
||
|
<Design.PreviewWith>
|
||
|
<Border
|
||
|
Width="400"
|
||
|
Height="200"
|
||
|
Margin="16"
|
||
|
Padding="48"
|
||
|
Background="{DynamicResource SystemAccentColor}">
|
||
|
<Border.ContextMenu>
|
||
|
<ContextMenu>
|
||
|
<MenuItem Header="Standard _Menu Item" />
|
||
|
<MenuItem Header="Disabled" IsEnabled="False" />
|
||
|
<Separator />
|
||
|
<MenuItem Header="Menu with _Submenu">
|
||
|
<MenuItem Header="Submenu _1" />
|
||
|
<MenuItem Header="Submenu _2" />
|
||
|
</MenuItem>
|
||
|
<MenuItem Header="Menu Item with _Icon" />
|
||
|
<MenuItem Header="Menu Item with _Checkbox">
|
||
|
<MenuItem.Icon>
|
||
|
<CheckBox
|
||
|
BorderThickness="0"
|
||
|
IsChecked="True"
|
||
|
IsHitTestVisible="False" />
|
||
|
</MenuItem.Icon>
|
||
|
</MenuItem>
|
||
|
</ContextMenu>
|
||
|
</Border.ContextMenu>
|
||
|
<TextBlock Text="Defined in XAML" />
|
||
|
</Border>
|
||
|
</Design.PreviewWith>
|
||
|
|
||
|
<!-- Added missing resource -->
|
||
|
<Thickness x:Key="MenuFlyoutScrollerMargin">0,4,0,4</Thickness>
|
||
|
|
||
|
<ControlTheme x:Key="{x:Type ContextMenu}" TargetType="ContextMenu">
|
||
|
<Setter Property="Background" Value="{DynamicResource MenuFlyoutPresenterBackground}" />
|
||
|
<Setter Property="BorderBrush" Value="{DynamicResource MenuFlyoutPresenterBorderBrush}" />
|
||
|
<Setter Property="BorderThickness" Value="{DynamicResource MenuFlyoutPresenterBorderThemeThickness}" />
|
||
|
<Setter Property="CornerRadius" Value="{DynamicResource OverlayCornerRadius}" />
|
||
|
<Setter Property="MaxWidth" Value="{DynamicResource FlyoutThemeMaxWidth}" />
|
||
|
<Setter Property="MinHeight" Value="{DynamicResource MenuFlyoutThemeMinHeight}" />
|
||
|
<Setter Property="Padding" Value="{DynamicResource MenuFlyoutPresenterThemePadding}" />
|
||
|
<Setter Property="HorizontalAlignment" Value="Stretch" />
|
||
|
<Setter Property="TextBlock.FontSize" Value="{DynamicResource ControlContentThemeFontSize}" />
|
||
|
<Setter Property="TextBlock.FontWeight" Value="Normal" />
|
||
|
<Setter Property="WindowManagerAddShadowHint" Value="False" />
|
||
|
<Setter Property="Template">
|
||
|
<ControlTemplate>
|
||
|
<Border
|
||
|
MinHeight="{TemplateBinding MinHeight}"
|
||
|
MaxWidth="{TemplateBinding MaxWidth}"
|
||
|
Padding="{TemplateBinding Padding}"
|
||
|
HorizontalAlignment="{TemplateBinding HorizontalAlignment}"
|
||
|
Background="{TemplateBinding Background}"
|
||
|
BorderBrush="{TemplateBinding BorderBrush}"
|
||
|
BorderThickness="{TemplateBinding BorderThickness}"
|
||
|
CornerRadius="{TemplateBinding CornerRadius}">
|
||
|
<ScrollViewer>
|
||
|
<ItemsPresenter
|
||
|
Name="PART_ItemsPresenter"
|
||
|
Margin="{DynamicResource MenuFlyoutScrollerMargin}"
|
||
|
Grid.IsSharedSizeScope="True"
|
||
|
ItemsPanel="{TemplateBinding ItemsPanel}"
|
||
|
KeyboardNavigation.TabNavigation="Continue" />
|
||
|
</ScrollViewer>
|
||
|
</Border>
|
||
|
</ControlTemplate>
|
||
|
</Setter>
|
||
|
</ControlTheme>
|
||
|
</ResourceDictionary>
|