<!-- 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.NavigationViewItemTemplatePage"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="clr-namespace:MUXControlsTestApp"
    xmlns:controls="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>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="*"/>
        </Grid.RowDefinitions>

        <Grid.Resources>
            <local:Customers x:Key="customers"/>
        </Grid.Resources>
        <Button AutomationProperties.Name="FocusAnchorButton">I'm just for grabbing focus</Button>
        <controls:NavigationView 
            x:Name="NavView" 
            PaneDisplayMode="Top"
            MenuItemsSource="{StaticResource customers}"
            ItemInvoked="NavView_ItemInvoked"
            SelectionChanged="NavView_SelectionChanged"
            Grid.Row="1">
            <controls:NavigationView.MenuItemTemplate>
                <DataTemplate>
                    <StackPanel Orientation="Horizontal">
                        <Button Content="{Binding LastName}" />
                        <Button Content="{Binding FirstName}" />
                    </StackPanel>
                </DataTemplate>
            </controls:NavigationView.MenuItemTemplate>

            <StackPanel Orientation="Vertical" Margin="8,0,0,0">
                <Button x:Name="FlipOrientation" AutomationProperties.Name="FlipOrientationButton" Content="Flip Orientation" Click="FlipOrientation_Click"/>
                <TextBlock x:Name="SelectionEventResult" AutomationProperties.Name="SelectionEventResult"></TextBlock>
                <StackPanel Orientation="Vertical">
                    <StackPanel Orientation="Horizontal">
                        <TextBlock Margin="5" HorizontalAlignment="Center" VerticalAlignment="Center">ItemInvoked Arguments (InvokedItem | InvokedItemContainer):</TextBlock>
                        <TextBox Margin="42,0,0,0" x:Name="ItemInvokedItemType" AutomationProperties.Name="ItemInvokedItemType" Text="N/A"/>
                        <TextBox x:Name="ItemInvokedItemContainerType" AutomationProperties.Name="ItemInvokedItemContainerType" Text="N/A"/>
                    </StackPanel>
                    <StackPanel Orientation="Horizontal">
                        <TextBlock Margin="5" HorizontalAlignment="Center" VerticalAlignment="Center">SelectionChanged Arguments (SelectedItem | SelectedItemContainer):</TextBlock>
                        <TextBox x:Name="SelectionChangedItemType" AutomationProperties.Name="SelectionChangedItemType" Text="N/A"/>
                        <TextBox x:Name="SelectionChangedItemContainerType" AutomationProperties.Name="SelectionChangedItemContainerType" Text="N/A"/>
                    </StackPanel>
                </StackPanel>
            </StackPanel>
        </controls:NavigationView>
    </Grid>

</local:TestPage>
