<!-- 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.NavigationViewSelectedItemEdgeCasePage"
    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">

    <Grid Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
        <Grid.RowDefinitions>
            <RowDefinition x:Name="MainGridRow" Height="*" />
        </Grid.RowDefinitions>
        <muxcontrols:NavigationView x:Name="NavView" AutomationProperties.Name="NavView" AutomationProperties.AutomationId="NavView"
                                    PaneTitle="NavView Test"
                                    HorizontalAlignment="Left"
                                    VerticalAlignment="Top"
                                    Header="Home"
                                    ExpandedModeThresholdWidth="1"
                                    Background="{ThemeResource ApplicationPageBackgroundThemeBrush}"
                                    SelectionChanged="NavView_SelectionChanged"
                                    IsSettingsVisible="false">

            <ScrollViewer Margin="8,0,0,0" Height="700">
                <StackPanel>
                    <Button Content="add" Click="Button_click"/>
                    <Button Content="Select Movies" Click="Movies_Click"/>
                    <Button Content="Select TV" Click="TV_Click"/>
                    <Button Content="Select Movies via IsSelected" Click="Movies_Click2"/>
                    <Button Content="Select TV via IsSelected" Click="TV_Click2"/>
                    <TextBlock Text="{Binding TVItem.IsSelected}"/>
                    <TextBlock Text="{Binding NavView.SelectedItem}"/>
                    <TextBlock x:Name="StatusTextBlock"  Text="John" AutomationProperties.Name="StatusTextBlock"/>
                    <Button Content="Copy status" Click="CopyIsSelected_Click" AutomationProperties.Name="CopyStatusButton"/>
                </StackPanel>
            </ScrollViewer>

            <muxcontrols:NavigationView.MenuItems>
                <muxcontrols:NavigationViewItem x:Name="MoviesItem">Browse Movies</muxcontrols:NavigationViewItem>
                <muxcontrols:NavigationViewItem x:Name="TVItem">Browse TV</muxcontrols:NavigationViewItem>
            </muxcontrols:NavigationView.MenuItems>
        </muxcontrols:NavigationView>
    </Grid>
</local:TestPage>
