<local:NavigablePage
    x:Class="Microsoft.PowerToys.Settings.UI.Views.CmdNotFoundPage"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:controls="using:Microsoft.PowerToys.Settings.UI.Controls"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:local="using:Microsoft.PowerToys.Settings.UI.Helpers"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:tkcontrols="using:CommunityToolkit.WinUI.Controls"
    xmlns:tkconverters="using:CommunityToolkit.WinUI.Converters"
    xmlns:ui="using:CommunityToolkit.WinUI"
    AutomationProperties.LandmarkType="Main"
    mc:Ignorable="d">
    <controls:SettingsPageControl x:Uid="CmdNotFound" ModuleImageSource="ms-appx:///Assets/Settings/Modules/CmdNotFound.png">
        <controls:SettingsPageControl.ModuleContent>
            <StackPanel ChildrenTransitions="{StaticResource SettingsCardsAnimations}" Orientation="Vertical">
                <InfoBar
                    x:Uid="GPO_CommandNotFound_ForceEnabled"
                    IsClosable="False"
                    IsOpen="{x:Bind ViewModel.IsModuleGpoEnabled, Mode=OneWay}"
                    IsTabStop="{x:Bind ViewModel.IsModuleGpoEnabled, Mode=OneWay}"
                    Severity="Informational">
                    <InfoBar.IconSource>
                        <FontIconSource FontFamily="{StaticResource SymbolThemeFontFamily}" Glyph="&#xE72E;" />
                    </InfoBar.IconSource>
                </InfoBar>
                <InfoBar
                    x:Uid="GPO_CommandNotFound_ForceDisabled"
                    IsClosable="False"
                    IsOpen="{x:Bind ViewModel.IsModuleGpoDisabled, Mode=OneWay}"
                    IsTabStop="{x:Bind ViewModel.IsModuleGpoDisabled, Mode=OneWay}"
                    Severity="Informational">
                    <InfoBar.IconSource>
                        <FontIconSource FontFamily="{StaticResource SymbolThemeFontFamily}" Glyph="&#xE72E;" />
                    </InfoBar.IconSource>
                </InfoBar>

                <tkcontrols:SettingsExpander
                    Name="CmdNotFoundEnable"
                    x:Uid="CmdNotFound_Enable"
                    HeaderIcon="{ui:BitmapIcon Source=/Assets/Settings/Icons/CommandNotFound.png}"
                    IsExpanded="True">
                    <tkcontrols:SwitchPresenter TargetType="x:Boolean" Value="{x:Bind ViewModel.IsCommandNotFoundModuleInstalled, Mode=OneWay}">
                        <tkcontrols:Case Value="True">
                            <StackPanel Orientation="Horizontal" Spacing="8">
                                <TextBlock
                                    x:Uid="InstalledLabel"
                                    VerticalAlignment="Center"
                                    Foreground="{ThemeResource TextFillColorSecondaryBrush}" />
                                <FontIcon
                                    Margin="0,0,4,0"
                                    VerticalAlignment="Center"
                                    AutomationProperties.AccessibilityView="Raw"
                                    Foreground="{ThemeResource SystemFillColorSuccessBrush}"
                                    Glyph="&#xEC61;" />
                                <HyperlinkButton
                                    x:Uid="CmdNotFound_UninstallButton"
                                    Command="{x:Bind ViewModel.UninstallModuleEventHandler}"
                                    IsEnabled="{x:Bind ViewModel.IsModuleGpoEnabled, Mode=OneWay, Converter={StaticResource BoolNegationConverter}}" />
                            </StackPanel>
                        </tkcontrols:Case>
                        <tkcontrols:Case Value="False">
                            <Button
                                x:Uid="CmdNotFound_InstallButton"
                                Command="{x:Bind ViewModel.InstallModuleEventHandler}"
                                IsEnabled="{x:Bind ViewModel.IsModuleGpoDisabled, Mode=OneWay, Converter={StaticResource BoolNegationConverter}}"
                                Style="{StaticResource AccentButtonStyle}" />
                        </tkcontrols:Case>
                    </tkcontrols:SwitchPresenter>
                    <tkcontrols:SettingsExpander.ItemsHeader>
                        <StackPanel>
                            <InfoBar
                                x:Uid="CmdNotFound_RequirementsBar"
                                BorderThickness="0"
                                CornerRadius="0"
                                IsClosable="False"
                                IsOpen="True">
                                <InfoBar.ActionButton>
                                    <HyperlinkButton x:Uid="CmdNotFound_CheckCompatibility" Command="{x:Bind ViewModel.CheckRequirementsEventHandler}">
                                        <ToolTipService.ToolTip>
                                            <TextBlock x:Uid="CmdNotFound_CheckCompatibilityTooltip" TextWrapping="Wrap" />
                                        </ToolTipService.ToolTip>
                                    </HyperlinkButton>
                                </InfoBar.ActionButton>
                            </InfoBar>
                        </StackPanel>
                    </tkcontrols:SettingsExpander.ItemsHeader>
                    <tkcontrols:SettingsExpander.Items>
                        <tkcontrols:SettingsCard Name="CmdNotFoundPowerShellDetection" x:Uid="CmdNotFound_PowerShellDetection">
                            <tkcontrols:SwitchPresenter TargetType="x:Boolean" Value="{x:Bind ViewModel.IsPowerShell7Detected, Mode=OneWay}">
                                <tkcontrols:Case Value="True">
                                    <StackPanel Orientation="Horizontal" Spacing="8">
                                        <TextBlock
                                            x:Uid="DetectedLabel"
                                            VerticalAlignment="Center"
                                            Foreground="{ThemeResource TextFillColorSecondaryBrush}" />
                                        <FontIcon
                                            AutomationProperties.AccessibilityView="Raw"
                                            Foreground="{ThemeResource SystemFillColorSuccessBrush}"
                                            Glyph="&#xEC61;" />
                                    </StackPanel>
                                </tkcontrols:Case>
                                <tkcontrols:Case Value="False">
                                    <StackPanel Orientation="Horizontal" Spacing="8">
                                        <TextBlock
                                            x:Uid="NotDetectedLabel"
                                            VerticalAlignment="Center"
                                            Foreground="{ThemeResource TextFillColorSecondaryBrush}" />
                                        <FontIcon
                                            AutomationProperties.AccessibilityView="Raw"
                                            Foreground="{ThemeResource SystemFillColorCriticalBrush}"
                                            Glyph="&#xEB90;" />
                                        <Button
                                            x:Uid="CmdNotFound_InstallButton"
                                            Command="{x:Bind ViewModel.InstallPowerShell7EventHandler}"
                                            IsEnabled="{x:Bind ViewModel.IsModuleGpoDisabled, Mode=OneWay, Converter={StaticResource BoolNegationConverter}}" />
                                    </StackPanel>
                                </tkcontrols:Case>
                            </tkcontrols:SwitchPresenter>
                        </tkcontrols:SettingsCard>

                        <tkcontrols:SettingsCard Name="CmdNotFoundWinGetClientDetection" x:Uid="CmdNotFound_WinGetClientDetection">
                            <tkcontrols:SwitchPresenter TargetType="x:Boolean" Value="{x:Bind ViewModel.IsWinGetClientModuleDetected, Mode=OneWay}">
                                <tkcontrols:Case Value="True">
                                    <StackPanel Orientation="Horizontal" Spacing="8">
                                        <TextBlock
                                            x:Uid="DetectedLabel"
                                            VerticalAlignment="Center"
                                            Foreground="{ThemeResource TextFillColorSecondaryBrush}" />
                                        <FontIcon
                                            AutomationProperties.AccessibilityView="Raw"
                                            Foreground="{ThemeResource SystemFillColorSuccessBrush}"
                                            Glyph="&#xEC61;" />
                                    </StackPanel>
                                </tkcontrols:Case>
                                <tkcontrols:Case Value="False">
                                    <StackPanel Orientation="Horizontal" Spacing="8">
                                        <TextBlock
                                            x:Uid="NotDetectedLabel"
                                            VerticalAlignment="Center"
                                            Foreground="{ThemeResource TextFillColorSecondaryBrush}" />
                                        <FontIcon
                                            AutomationProperties.AccessibilityView="Raw"
                                            Foreground="{ThemeResource SystemFillColorCriticalBrush}"
                                            Glyph="&#xEB90;" />
                                        <Button
                                            x:Uid="CmdNotFound_InstallButton"
                                            Command="{x:Bind ViewModel.InstallWinGetClientModuleEventHandler}"
                                            IsEnabled="{x:Bind ViewModel.IsModuleGpoDisabled, Mode=OneWay, Converter={StaticResource BoolNegationConverter}}" />
                                    </StackPanel>
                                </tkcontrols:Case>
                            </tkcontrols:SwitchPresenter>
                        </tkcontrols:SettingsCard>
                    </tkcontrols:SettingsExpander.Items>
                </tkcontrols:SettingsExpander>
                <TextBlock
                    x:Uid="CmdNotFound_ModuleInstallationLogs"
                    Margin="0,12,0,4"
                    Style="{ThemeResource BodyStrongTextBlockStyle}" />
                <TextBox
                    Height="300"
                    FontFamily="Consolas"
                    IsReadOnly="True"
                    Text="{x:Bind ViewModel.CommandOutputLog, Mode=OneWay}"
                    TextWrapping="Wrap" />
            </StackPanel>
        </controls:SettingsPageControl.ModuleContent>

        <controls:SettingsPageControl.PrimaryLinks>
            <controls:PageLink x:Uid="LearnMore_CmdNotFound" Link="https://aka.ms/PowerToysOverview_CmdNotFound" />
        </controls:SettingsPageControl.PrimaryLinks>
    </controls:SettingsPageControl>
</local:NavigablePage>
