<!-- 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.NavigationViewTopNavPage"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="clr-namespace:MUXControlsTestApp"
    xmlns:muxcontrols="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"
    Loaded="TestPage_Loaded">

    <local:TestPage.Resources>
        <Style x:Key="AlternateToggleButtonStyle" TargetType="Button" BasedOn="{StaticResource DefaultButtonStyle}">
            <Setter Property="Content" Value="yo"/>
            <Setter Property="Background" Value="Chartreuse"/>
        </Style>
    </local:TestPage.Resources>

    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition x:Name="MainGridRow" Height="*" />
        </Grid.RowDefinitions>
        <muxcontrols:NavigationView x:Name="NavView" AutomationProperties.Name="NavView" AutomationProperties.AutomationId="NavView"
                PaneTitle="NavView Test"
                DisplayModeChanged="NavView_DisplayModeChanged"
                SelectionChanged="NavView_SelectionChanged"
                HorizontalAlignment="Left"
                VerticalAlignment="Top"
                CompactModeThresholdWidth="480"
                Background="{ThemeResource ApplicationPageBackgroundThemeBrush}"
                PaneClosing="NavView_PaneClosing"
                PaneClosed="NavView_PaneClosed"
                PaneOpening="NavView_PaneOpening"
                PaneOpened="NavView_PaneOpened"
                BackRequested="NavView_BackRequested"
                PaneDisplayMode="Top">
            <muxcontrols:NavigationView.MenuItems>
                <muxcontrols:NavigationViewItem x:Name="HomeItem" Content="Home" Icon="Home"/>
                <muxcontrols:NavigationViewItem x:Name="AppsItem" Content="Apps" Icon="Shop" />
                <muxcontrols:NavigationViewItem x:Name="GamesItem" Content="Games" Icon="Emoji"/>
                <muxcontrols:NavigationViewItem x:Name="CollapsedItem1" Content="CollapsedItem 1" Visibility="Collapsed"/>
                <muxcontrols:NavigationViewItem x:Name="CollapsedItem2" Content="CollapsedItem 2" Visibility="Collapsed"/>
                <muxcontrols:NavigationViewItemSeparator />
                <muxcontrols:NavigationViewItemHeader x:Name="HeaderTextItem" Content="Header Text" />
                <muxcontrols:NavigationViewItem x:Name="MusicItem" Content="Music" Icon="Audio"/>
                <muxcontrols:NavigationViewItem x:Name="MoviesItem" Content="Movies" Icon="Video"/>
                <muxcontrols:NavigationViewItemHeader x:Name="HeaderTextItem2" Content="Header Text 2" />
                <muxcontrols:NavigationViewItem x:Name="TVItem" Content="TV" Icon="Slideshow"/>
                <muxcontrols:NavigationViewItem x:Name="CollapsedItem3" Content="CollapsedItem 3" Visibility="Collapsed"/>
                <muxcontrols:NavigationViewItem x:Name="VolumeItem" AutomationProperties.Name="Volume" Icon="Volume">
                    <muxcontrols:NavigationViewItem.Content>
                        <TextBlock Text="Volume (don't click me)" />
                    </muxcontrols:NavigationViewItem.Content>
                </muxcontrols:NavigationViewItem>
                <muxcontrols:NavigationViewItem x:Name="IntegerItem" AutomationProperties.Name="Integer" Icon="Accept"/>
            </muxcontrols:NavigationView.MenuItems>

            <ScrollViewer Margin="8,0,0,0">
                <StackPanel>
                    <StackPanel Orientation="Horizontal">
                        <TextBlock x:Name="DisplayModeTextBox" 
                                   AutomationProperties.Name="DisplayModeTextBox"
                                   Style="{StaticResource BodyTextBlockStyle}"
                                   Margin="12,0,0,0" 
                                   VerticalAlignment="Center"/>

                        <ComboBoxEx x:Name="WidthCombobox" Header="Width"
                                  AutomationProperties.Name="WidthComboBox"
                                  SelectionChanged="WidthCombobox_SelectionChanged"
                                  Margin="12,0,0,0" >
                            <ComboBoxItem Content="300" Tag="300" AutomationProperties.Name="Narrow"/>
                            <ComboBoxItem Content="645" Tag="645" AutomationProperties.Name="Medium"/>
                            <ComboBoxItem Content="1010" Tag="1010" AutomationProperties.Name="Wide"/>
                        </ComboBoxEx>
                    </StackPanel>

                    <StackPanel Orientation="Horizontal">
                        <CheckBox
                            x:Name="IsPaneOpenCheckBox"
                            AutomationProperties.Name="IsPaneOpenCheckBox"
                            Content="IsPaneOpen"
                            IsChecked="{Binding IsPaneOpen, ElementName=NavView, Mode=TwoWay}"
                            Margin="5"/>

                        <Button x:Name="AddItemButton" AutomationProperties.Name="AddItemButton" Content="Add Item" Click="AddItemButton_Click"  Margin="5"/>
                        <Button x:Name="RemoveItemButton" AutomationProperties.Name="RemoveItemButton" Content="Remove Item" Click="RemoveItemButton_Click"  Margin="5"/>
                        <Button x:Name="AddFooterItemButton" AutomationProperties.Name="AddFooterItemButton" Content="Add Footer Item" Click="AddFooterItemButton_Click" Margin="5" />
                        <Button x:Name="RemoveFooterItemButton" AutomationProperties.Name="RemoveFooterItemButton" Content="Remove Footer Item" Click="RemoveFooterItemButton_Click" Margin="5" />
                        <Button x:Name="ClearMenuButton" AutomationProperties.Name="ClearMenuButton" Content="Clear menu" Click="ClearMenuButton_Click"  Margin="5"/>
                    </StackPanel>

                    <StackPanel Orientation="Horizontal">
                        <ComboBoxEx x:Name="CompactModeCombobox"
                                  Header="Compact Mode"
                                  SelectionChanged="CompactModeCombobox_SelectionChanged"
                                  AutomationProperties.Name="CompactModeComboBox"
                                  Margin="5">
                            <ComboBoxItem Content="0" Tag="0"/>
                            <ComboBoxItem Content="641" Tag="641" AutomationProperties.Name="Low"/>
                            <ComboBoxItem Content="1008" Tag="1008" AutomationProperties.Name="High"/>
                            <ComboBoxItem Content="10 000" Tag="10000"/>
                        </ComboBoxEx>

                        <ComboBoxEx x:Name="ExpandedModeCombobox" 
                                  Header="Expanded Mode"
                                  SelectionChanged="ExpandedModeCombobox_SelectionChanged"
                                  AutomationProperties.Name="ExpandedModeComboBox"
                                  Margin="5">
                            <ComboBoxItem Content="0" Tag="0"/>
                            <ComboBoxItem Content="641" Tag="641" AutomationProperties.Name="Low"/>
                            <ComboBoxItem Content="1008" Tag="1008" AutomationProperties.Name="High"/>
                            <ComboBoxItem Content="10 000" Tag="10000"/>
                        </ComboBoxEx>

                        <ComboBoxEx x:Name="CompactPaneLength" Header="Compact Pane Length" SelectionChanged="CompactPaneLength_SelectionChanged"  Margin="5">
                            <ComboBoxItem Content="0" Tag="0"/>
                            <ComboBoxItem Content="40" Tag="40"/>
                            <ComboBoxItem Content="48" Tag="48"/>
                            <ComboBoxItem Content="96" Tag="96"/>
                        </ComboBoxEx>

                        <ComboBoxEx x:Name="OpenPaneLength" Header="Expanded Pane Length" SelectionChanged="OpenPaneLength_SelectionChanged" Margin="5">
                            <ComboBoxItem Content="0" Tag="0"/>
                            <ComboBoxItem Content="320" Tag="320"/>
                            <ComboBoxItem Content="648" Tag="648"/>
                        </ComboBoxEx>
                    </StackPanel>

                    <StackPanel Orientation="Horizontal">
                        <ComboBoxEx x:Name="HeightCombobox"
                                  Header="Height"
                                  SelectionChanged="HeightCombobox_SelectionChanged"
                                  AutomationProperties.Name="HeightCombobox"
                                  Margin="5">
                            <ComboBoxItem Content="Default" Tag="Default" AutomationProperties.Name="Default" />
                            <ComboBoxItem Content="300" Tag="300" AutomationProperties.Name="Small" />
                        </ComboBoxEx>
                        <CheckBox x:Name="BackButtonVisibilityCheckbox" AutomationProperties.Name="BackButtonVisibilityCheckbox" Content="Back Visible" Checked="BackButtonVisibilityCheckbox_Checked" Unchecked="BackButtonVisibilityCheckbox_Unchecked" IsChecked="True" Margin="5"/>
                        <CheckBox x:Name="BackButtonEnabledCheckbox" AutomationProperties.Name="BackButtonEnabledCheckbox" Content="Back Enabled" Checked="BackButtonEnabledCheckbox_Checked" Unchecked="BackButtonEnabledCheckbox_Unchecked" Margin="5"/>
                        <CheckBox x:Name="SelectionFollowFocusCheckbox" AutomationProperties.Name="SelectionFollowFocusCheckbox" Content="SelectionFollowFocus Enabled" Checked="SelectionFollowFocus_Checked" Unchecked="SelectionFollowFocus_Unchecked" Margin="5"/>
                        <TextBlock x:Name="BackRequestedStateTextBlock" AutomationProperties.Name="BackRequestedStateTextBlock" Text="Test Not Started [2]"/>
                        <Button x:Name="BackRequestedStateResetButton" AutomationProperties.Name="BackRequestedStateResetButton" Click="BackRequestedStateResetButton_Click">
                            <Button.Content>
                                <muxcontrols:SymbolIcon Symbol="Refresh"/>
                            </Button.Content>
                        </Button>
                    </StackPanel>

                    <StackPanel Orientation="Horizontal">
                        <ComboBoxEx x:Name="SelectedItemCombobox"
                                AutomationProperties.Name="SelectedItemCombobox"
                                Header="Selected Item (sets programmatically)"
                                SelectionChanged="SelectedItemCombobox_SelectionChanged"
                                Margin="5">
                            <ComboBoxItem Content="Home" Tag="Home"/>
                            <ComboBoxItem Content="Apps" Tag="Apps"/>
                            <ComboBoxItem Content="Games" Tag="Games"/>
                            <ComboBoxItem Content="Music" Tag="Music"/>
                            <ComboBoxItem Content="Movies" Tag="Movies"/>
                            <ComboBoxItem Content="TV" Tag="TV"/>
                            <ComboBoxItem Content="Settings" Tag="Settings"/>
                        </ComboBoxEx>
                        <Button x:Name="ChangePaneTitle" AutomationProperties.Name="ChangePaneTitleButton" Content="Change PaneTitle" Click="ChangePaneTitle_Click"/>
                        <Button x:Name="FlipOrientation" AutomationProperties.Name="FlipOrientationButton" Content="Flip Orientation" Click="FlipOrientation_Click"/>
                        <Button x:Name="ClearSelectedItem" AutomationProperties.Name="ClearSelectedItemButton" Content="Clear SelectedItem" Click="ClearSelectedItem_Click"/>
                    </StackPanel>

                    <StackPanel Orientation="Horizontal">
                        <CheckBox x:Name="SettingsItemVisibilityCheckbox" AutomationProperties.Name="SettingsItemVisibilityCheckbox" Content="Show Settings" Checked="SettingsItemVisibilityCheckbox_Checked" Unchecked="SettingsItemVisibilityCheckbox_Unchecked" Margin="5"/>
                        <CheckBox x:Name="PaneToggleButtonVisiblityCheckbox" AutomationProperties.Name="PaneToggleButtonVisiblityCheckbox" Content="Show Hamburger Button" Checked="PaneToggleButtonVisiblityCheckbox_Checked" Unchecked="PaneToggleButtonVisiblityCheckbox_Unchecked" Margin="5"/>
                        <CheckBox x:Name="AutoSuggestCheckbox" AutomationProperties.Name="AutoSuggestCheckbox" Content="Set AutoSuggestBox" IsChecked="True" Checked="AutoSuggestCheckbox_Checked" Unchecked="AutoSuggestCheckbox_Unchecked" Margin="5"/>
                        <CheckBox x:Name="HeaderVisiblityCheckbox" AutomationProperties.Name="HeaderVisiblityCheckbox" Content="Always Show Header" Checked="HeaderVisiblityCheckbox_Checked" Unchecked="HeaderVisiblityCheckbox_Unchecked" Margin="5"/>
                    </StackPanel>

                    <StackPanel Orientation="Horizontal">
                        <CheckBox x:Name="ToggleButtonStyleCheckbox" AutomationProperties.Name="ToggleButtonStyleCheckbox" Content="Alternate Toggle Button" Checked="ToggleButtonStyleCheckbox_Checked" Unchecked="ToggleButtonStyleCheckbox_Unchecked" IsChecked="False" Margin="5"/>
                        <TextBlock x:Name="ToggleButtonBackgroundColor" AutomationProperties.Name="ToggleButtonBackgroundColor"  Margin="5"/>
                        <CheckBox x:Name="MoviesEnabledCheckbox" AutomationProperties.Name="MoviesEnabledCheckbox" Content="Movies+TV Enabled" Checked="MoviesEnabledCheckbox_Checked" Unchecked="MoviesEnabledCheckbox_Unchecked" IsChecked="True"  Margin="5"/>
                        <Button x:Name="SetHeaderButton" AutomationProperties.Name="SetHeaderButton" Content="Set Header" Click="SetHeaderButton_Click"/>
                    </StackPanel>

                    <StackPanel Orientation="Horizontal">
                        <CheckBox x:Name="TitleBarCheckbox" AutomationProperties.Name="TitleBarCheckbox" Content="Show Title Bar" Checked="TitleBarCheckbox_Checked" Unchecked="TitleBarCheckbox_Unchecked" IsChecked="True"  Margin="5"/>
                        <CheckBox x:Name="TestFrameCheckbox" AutomationProperties.Name="TestFrameCheckbox" Content="Show Test Frame" Checked="TestFrameCheckbox_Checked" Unchecked="TestFrameCheckbox_Unchecked" IsChecked="True"  Margin="5"/>
                        <Button x:Name="ReverseButton" AutomationProperties.Name="ReverseButton" Content="Reverse Titles" Click="ScrambleButton_Click"/>
                        <Button x:Name="CopyGamesLabelButton" AutomationProperties.Name="CopyGamesLabelButton" Content="Copy Games Label" Click="CopyGamesLabelButton_Click"/>
                        <Button x:Name="CopyVolumeToolTipButton" AutomationProperties.Name="CopyVolumeToolTipButton" Content="Copy Volume ToolTip" Click="CopyVolumeToolTipButton_Click"/>
                        <TextBlock x:Name="ToolTipStatusTextBlock" AutomationProperties.Name="ToolTipStatusTextBlock" Text="Test not started"/>
                    </StackPanel>

                    <StackPanel Orientation="Horizontal">
                        <CheckBox x:Name="CancelClosingEvents" AutomationProperties.Name="CancelClosingEvents" Content="Cancel Closing Events" IsChecked="False"  Margin="5"/>
                        <TextBlock x:Name="LastIngEventText" AutomationProperties.Name="LastIngEventText" Text="No event fired yet"/>
                        <TextBlock x:Name="LastEdEventText" AutomationProperties.Name="LastEdEventText" Text="No event fired yet [2]"/>
                        <Button x:Name="ClosingEventCountResetButton" AutomationProperties.Name="ClosingEventCountResetButton" Click="ClosingEventCountResetButton_Click">
                            <Button.Content>
                                <muxcontrols:SymbolIcon Symbol="Refresh"/>
                            </Button.Content>
                        </Button>
                        <TextBlock x:Name="ClosingEventCountTextBlock" AutomationProperties.Name="ClosingEventCountTextBlock" Text="X X"/>
                        <TextBlock x:Name="PaneOpenedOrClosedEvent" AutomationProperties.Name="PaneOpenedOrClosedEvent" Text="Unknown" />
                    </StackPanel>

                    <StackPanel Orientation="Horizontal">
                        <Button x:Name="GetOverflowMenuCornerRadiusButton" AutomationProperties.Name="GetOverflowMenuCornerRadiusButton" Content="GetOverflowMenuCornerRadius"
                                Margin="0,0,2,0" Click="GetOverflowMenuCornerRadiusButton_Click"/>
                        <TextBlock Margin="5" HorizontalAlignment="Center" VerticalAlignment="Center">CornerRadius:</TextBlock>
                        <TextBlock x:Name="OverflowMenuCornerRadiusTextBlock" AutomationProperties.Name="OverflowMenuCornerRadiusTextBlock" HorizontalAlignment="Center" VerticalAlignment="Center">-</TextBlock>
                    </StackPanel>

                    <TextBlock TextWrapping="Wrap" Grid.Row="1" Margin="5">
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Mauris faucibus quam id sem porta posuere. Interdum et malesuada fames ac ante ipsum primis in faucibus. Morbi sodales suscipit justo quis consequat. Vestibulum lectus magna, mattis id eleifend sed, congue eget lectus. Nam et sem pellentesque, dignissim erat eu, tincidunt lacus. Ut porttitor tincidunt ullamcorper. Vestibulum sodales neque purus, vitae eleifend metus convallis in. Etiam non metus nec ligula pharetra molestie. Donec dignissim dapibus blandit. Orci varius natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. 
                        
Cras laoreet feugiat nisi, quis consectetur mi mattis et. Integer luctus, nunc ac lobortis volutpat, ligula magna commodo diam, sit amet scelerisque diam mauris nec urna. Sed consectetur, libero at efficitur tincidunt, sem nunc pharetra felis, vitae accumsan lorem ligula at ligula. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aliquam finibus odio ut augue tempor, a egestas leo ornare. Sed varius magna sed tellus tempus viverra. Suspendisse potenti. Pellentesque eget nibh quis quam pellentesque molestie et sit amet arcu. Donec eget sollicitudin metus. Fusce sit amet semper quam. Curabitur quis suscipit lorem. Donec dictum, ipsum eu congue consequat, enim nulla lacinia lorem, nec molestie arcu lacus quis velit. 

Aenean nisl est, sollicitudin eu libero in, aliquam accumsan sapien. Nunc fermentum rutrum augue nec tincidunt. Pellentesque maximus iaculis purus auctor ullamcorper. Proin nec libero id erat tincidunt venenatis sit amet at risus. Nunc sagittis facilisis est ut venenatis. Etiam eget elit hendrerit, dictum libero vel, cursus risus. Nunc nec elit lacus. Nam a libero eros. Nullam nec semper orci. Vivamus sed aliquet eros, et elementum metus. Nullam et suscipit nunc. Curabitur congue urna ut consequat vestibulum. Pellentesque accumsan molestie pellentesque. Duis eget ipsum ac diam bibendum eleifend vitae quis diam. Suspendisse condimentum, turpis eu vehicula dignissim, sem dui euismod neque, eu condimentum arcu ante at mi. Fusce justo neque, congue vel libero ac, consectetur lobortis purus. 

Nullam egestas, orci sed molestie aliquet, diam ex euismod risus, ac dapibus quam magna sit amet odio. Mauris commodo felis lorem, ut faucibus lorem tristique vitae. Maecenas id orci porta, varius velit a, fringilla sem. Maecenas vulputate eu odio a dictum. Pellentesque vitae interdum mauris. Donec et imperdiet est. Suspendisse eget velit in enim varius suscipit. Integer pellentesque egestas magna, sed hendrerit leo dignissim ut. Vestibulum eget placerat libero. Integer accumsan eros leo, vitae auctor purus aliquam vel. Cras rutrum pulvinar velit et commodo. Fusce porta blandit nunc et euismod. Vestibulum sit amet molestie nisl. Fusce odio quam, maximus eu consectetur nec, bibendum a leo. Ut arcu quam, interdum in lectus ut, aliquet semper neque.
                    </TextBlock>
                </StackPanel>
            </ScrollViewer>

            <muxcontrols:NavigationView.AutoSuggestBox>
                <muxcontrols:AutoSuggestBox QueryIcon="Find" AutomationProperties.Name="PaneAutoSuggestBox"/>
            </muxcontrols:NavigationView.AutoSuggestBox>

            <muxcontrols:NavigationView.PaneFooter>
                <Grid Background="Plum">
                    <Button x:Name="FooterButton" AutomationProperties.Name="FooterButton" Content="Footer Button" Margin="5"/>
                </Grid>
            </muxcontrols:NavigationView.PaneFooter>
        </muxcontrols:NavigationView>
    </Grid>

</local:TestPage>
