<ResourceDictionary
    xmlns="https://github.com/avaloniaui"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    x:CompileBindings="True">
    <Design.PreviewWith>
        <ThemeVariantScope RequestedThemeVariant="Dark">
            <MenuFlyoutPresenter>
                <MenuFlyoutPresenter.Items>
                    <MenuItem Header="Menu Item 1" />
                    <MenuItem Header="Menu Item 2" />
                    <MenuItem Header="Menu Item 3" />
                    <MenuItem Header="Menu Item 4" />
                    <MenuItem Header="Menu Item 5" />
                    <MenuItem Header="Menu Item 6" />
                </MenuFlyoutPresenter.Items>
            </MenuFlyoutPresenter>
        </ThemeVariantScope>
    </Design.PreviewWith>

    <ControlTheme x:Key="{x:Type MenuFlyoutPresenter}" TargetType="MenuFlyoutPresenter">
        <Setter Property="MenuFlyoutPresenter.Background" Value="{DynamicResource MenuFlyoutBackground}" />
        <Setter Property="MenuFlyoutPresenter.BorderBrush" Value="{DynamicResource MenuFlyoutBorderBrush}" />
        <Setter Property="MenuFlyoutPresenter.BorderThickness" Value="{DynamicResource MenuFlyoutBorderThickness}" />
        <Setter Property="MenuFlyoutPresenter.Padding" Value="{DynamicResource MenuFlyoutPadding}" />
        <Setter Property="MenuFlyoutPresenter.FontSize" Value="{DynamicResource TextBlockFontSize}" />
        <Setter Property="MenuFlyoutPresenter.FontWeight" Value="{DynamicResource TextBlockFontWeight}" />
        <Setter Property="MenuFlyoutPresenter.Foreground" Value="{DynamicResource TextBlockDefaultForeground}" />
        <Setter Property="ScrollViewer.HorizontalScrollBarVisibility" Value="Auto" />
        <Setter Property="ScrollViewer.VerticalScrollBarVisibility" Value="Auto" />
        <Setter Property="MenuFlyoutPresenter.CornerRadius" Value="{DynamicResource MenuFlyoutCornerRadius}" />
        <Setter Property="MenuFlyoutPresenter.Template">
            <ControlTemplate TargetType="MenuFlyoutPresenter">
                <Border
                    Name="LayoutRoot"
                    Margin="4"
                    Background="{TemplateBinding Background}"
                    BorderBrush="{TemplateBinding BorderBrush}"
                    BorderThickness="{TemplateBinding BorderThickness}"
                    BoxShadow="{DynamicResource MenuFlyoutBorderBoxShadow}"
                    ClipToBounds="True"
                    CornerRadius="{TemplateBinding CornerRadius}"
                    UseLayoutRounding="False">
                    <ScrollViewer
                        Theme="{StaticResource MenuScrollViewer}"
                        CornerRadius="{TemplateBinding CornerRadius}"
                        HorizontalScrollBarVisibility="{TemplateBinding ScrollViewer.HorizontalScrollBarVisibility}"
                        VerticalScrollBarVisibility="{TemplateBinding ScrollViewer.VerticalScrollBarVisibility}">
                        <ItemsPresenter
                            Name="PART_ItemsPresenter"
                            Margin="{TemplateBinding Padding}"
                            Grid.IsSharedSizeScope="True"
                            ItemsPanel="{TemplateBinding ItemsPanel}"
                            KeyboardNavigation.TabNavigation="Continue" />
                    </ScrollViewer>
                </Border>
            </ControlTemplate>
        </Setter>
    </ControlTheme>
</ResourceDictionary>
