<UserControl
    x:Class="Microsoft.PowerToys.Settings.UI.OOBE.Views.OobeShellPage"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="using:Microsoft.PowerToys.Settings.UI.OOBE.Views"
    xmlns:winui="using:Microsoft.UI.Xaml.Controls"
    xmlns:localModels="using:Microsoft.PowerToys.Settings.UI.OOBE.ViewModel"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    winui:BackdropMaterial.ApplyToRootOrPageBackground="True"
    mc:Ignorable="d"
    HighContrastAdjustment="None">

    <UserControl.Resources>
        <DataTemplate x:Key="NavigationViewMenuItem" x:DataType="localModels:OobePowerToysModule">
            <winui:NavigationViewItem Content="{x:Bind ModuleName}" Tag="{x:Bind Tag}">
                <winui:NavigationViewItem.Icon>
                    <BitmapIcon UriSource="{x:Bind FluentIcon}" ShowAsMonochrome="False"/>
                </winui:NavigationViewItem.Icon>
            </winui:NavigationViewItem>
        </DataTemplate>
    </UserControl.Resources>

    <Grid Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
        <VisualStateManager.VisualStateGroups>
            <VisualStateGroup x:Name="LayoutVisualStates">
                <VisualState x:Name="WideLayout">
                    <VisualState.StateTriggers>
                        <AdaptiveTrigger MinWindowWidth="720" />
                    </VisualState.StateTriggers>
                </VisualState>
                <VisualState x:Name="SmallLayout">
                    <VisualState.StateTriggers>
                        <AdaptiveTrigger MinWindowWidth="600" />
                        <AdaptiveTrigger MinWindowWidth="0" />
                    </VisualState.StateTriggers>
                    <VisualState.Setters>
                        <Setter Target="NavigationView.PaneDisplayMode"
                                Value="LeftMinimal" />
                        <Setter Target="NavigationView.IsPaneToggleButtonVisible"
                                Value="True" />
                    </VisualState.Setters>
                </VisualState>
            </VisualStateGroup>
        </VisualStateManager.VisualStateGroups>
        <winui:NavigationView IsSettingsVisible="False"
                              IsPaneToggleButtonVisible="False"
                              IsPaneOpen="True"
                              x:Name="NavigationView"
                              OpenPaneLength="296"
                              PaneDisplayMode="Left"
                              SelectionChanged="NavigationView_SelectionChanged"
                              IsBackButtonVisible="Collapsed"
                              MenuItemsSource="{x:Bind Modules, Mode=OneTime}"
                              MenuItemTemplate="{StaticResource NavigationViewMenuItem}">
            <winui:NavigationView.Content>
                <Frame x:Name="NavigationFrame" />
            </winui:NavigationView.Content>
        </winui:NavigationView>
    </Grid>
</UserControl>
