Ionite
1 year ago
4 changed files with 87 additions and 4 deletions
@ -0,0 +1,74 @@
|
||||
<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> |
Loading…
Reference in new issue