<!-- Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT License. See LICENSE in the project root for license information. -->
<local:TestPage
    x:Class="MUXControlsTestApp.MenuBarPage"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="clr-namespace:MUXControlsTestApp"
    xmlns:muxc="http://schemas.modernwpf.com/2019"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    mc:Ignorable="d">

    <Grid
        Background="{DynamicResource ApplicationPageBackgroundThemeBrush}"
        Margin="12">

        <Grid.RowDefinitions>
            <RowDefinition Height="Auto" />
            <RowDefinition Height="Auto" />
            <RowDefinition Height="Auto" />
            <RowDefinition Height="*" />
        </Grid.RowDefinitions>

        <StackPanel
            x:Name="contentRoot"
            Grid.Row="0">
            <Button
                AutomationProperties.Name="FirstButton"
                Content="Element to test that focus moves correctly" />

            <TextBlock
                Text="Sample controls"
                Style="{DynamicResource StandardGroupHeader}" />
            <Menu x:Name="menuBar">
                <MenuItem
                    x:Name="FileItem"
                    AutomationProperties.Name="FileItem"
                    Header="File">
                    <MenuItem
                        x:Name="NewItem"
                        AutomationProperties.Name="NewItem"
                        Header="New"
                        Click="NewItem_Click" />
                    <MenuItem Header="Open..." />
                    <MenuItem Header="Save" />
                    <MenuItem Header="Save As..." />
                    <Separator />
                    <MenuItem Header="Page Setup..." />
                    <MenuItem Header="Print..." />
                    <Separator />
                    <MenuItem Header="Exit" />
                </MenuItem>

                <MenuItem
                    x:Name="EditItem"
                    AutomationProperties.Name="EditItem"
                    Header="Edit">
                    <MenuItem
                        x:Name="UndoItem"
                        AutomationProperties.Name="UndoItem"
                        Header="Undo" />
                    <Separator />
                    <MenuItem
                        x:Name="CutItem"
                        AutomationProperties.Name="CutItem"
                        Header="Cut" />
                    <MenuItem Header="Copy" />
                    <MenuItem Header="Paste" />
                    <MenuItem Header="Delete" />
                    <Separator />
                    <MenuItem Header="Sub menu">
                        <MenuItem Header="Item 1" />
                        <MenuItem Header="Item 2" />
                        <MenuItem Header="Item 3" />
                    </MenuItem>
                </MenuItem>

                <MenuItem Header="Format">
                    <MenuItem Header="Word Wrap" />
                    <MenuItem Header="Font..." />
                </MenuItem>
            </Menu>

            <Menu
                x:Name="SizedMenuBar"
                AutomationProperties.Name="SizedMenuBar"
                Height="24">
                <MenuItem
                    x:Name="SizedMenuBarItem"
                    AutomationProperties.Name="SizedMenuBarItem"
                    Header="Size" />
            </Menu>
        </StackPanel>
        <TextBlock
            Grid.Row="1"
            Text="Options"
            Style="{DynamicResource StandardGroupHeader}" />
        <StackPanel
            Margin="0,20,0,20"
            VerticalAlignment="Top"
            Grid.Row="2"
            Orientation="Horizontal">
            <StackPanel.Resources>
                <Style TargetType="Button" BasedOn="{StaticResource DefaultButtonStyle}">
                    <Setter Property="Margin" Value="4" />
                </Style>
            </StackPanel.Resources>
            <CheckBox
                x:Name="TestFrameCheckbox"
                AutomationProperties.Name="TestFrameCheckbox"
                Content="Show Test Frame"
                Checked="TestFrameCheckbox_Checked"
                Unchecked="TestFrameCheckbox_Unchecked"
                IsChecked="True"
                Margin="5" />
            <Button
                x:Name="AddMenuBarItemButton"
                AutomationProperties.Name="AddMenuBarItemButton"
                Click="AddMenuBarItem_Click"
                Content="Add Menu Bar Item" />
            <Button
                x:Name="RemoveMenuBarItemButton"
                AutomationProperties.Name="RemoveMenuBarItemButton"
                Click="RemoveMenuBarItem_Click"
                Content="Remove Menu Bar Item" />
            <Button
                x:Name="AddFlyoutItemButton"
                AutomationProperties.Name="AddFlyoutItemButton"
                Click="AddFlyoutItem_Click"
                Content="Add Flyout Item" />
            <Button
                x:Name="RemoveFlyoutItemButton"
                AutomationProperties.Name="RemoveFlyoutItemButton"
                Click="RemoveFlyoutItem_Click"
                Content="Remove Flyout Item" />
        </StackPanel>
        <StackPanel Grid.Row="3">
            <TextBlock
                Text="Test output"
                Style="{DynamicResource StandardGroupHeader}" />
            <TextBlock x:Name="TextOutput" />
        </StackPanel>
    </Grid>
</local:TestPage>
