<Page
    x:Class="Microsoft.PowerToys.Settings.UI.Views.PowerRenamePage"
    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:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:tkcontrols="using:CommunityToolkit.WinUI.Controls"
    xmlns:ui="using:CommunityToolkit.WinUI"
    AutomationProperties.LandmarkType="Main"
    mc:Ignorable="d">

    <controls:SettingsPageControl x:Uid="PowerRename" ModuleImageSource="ms-appx:///Assets/Settings/Modules/PowerRename.png">
        <controls:SettingsPageControl.ModuleContent>
            <StackPanel
                x:Name="PowerRenameView"
                ChildrenTransitions="{StaticResource SettingsCardsAnimations}"
                Orientation="Vertical">
                <tkcontrols:SettingsCard
                    x:Uid="PowerRename_Toggle_Enable"
                    HeaderIcon="{ui:BitmapIcon Source=/Assets/Settings/Icons/PowerRename.png}"
                    IsEnabled="{x:Bind ViewModel.IsEnabledGpoConfigured, Mode=OneWay, Converter={StaticResource BoolNegationConverter}}">
                    <ToggleSwitch x:Uid="ToggleSwitch" IsOn="{x:Bind ViewModel.IsEnabled, Mode=TwoWay}" />
                </tkcontrols:SettingsCard>
                <InfoBar
                    x:Uid="GPO_SettingIsManaged"
                    IsClosable="False"
                    IsOpen="{x:Bind ViewModel.IsEnabledGpoConfigured, Mode=OneWay}"
                    IsTabStop="{x:Bind ViewModel.IsEnabledGpoConfigured, Mode=OneWay}"
                    Severity="Informational" />
                <controls:SettingsGroup x:Uid="PowerRename_ShellIntegration" IsEnabled="{x:Bind ViewModel.IsEnabled, Mode=OneWay}">
                    <tkcontrols:SettingsExpander x:Uid="PowerRename_Toggle_ContextMenu" IsExpanded="False">
                        <ComboBox MinWidth="{StaticResource SettingActionControlMinWidth}" SelectedIndex="{x:Bind ViewModel.EnabledOnContextExtendedMenu, Mode=TwoWay, Converter={StaticResource BoolToComboBoxIndexConverter}}">
                            <ComboBoxItem x:Uid="PowerRename_Toggle_StandardContextMenu" />
                            <ComboBoxItem x:Uid="PowerRename_Toggle_ExtendedContextMenu" />
                        </ComboBox>
                        <tkcontrols:SettingsExpander.Items>
                            <tkcontrols:SettingsCard ContentAlignment="Left">
                                <CheckBox x:Uid="PowerRename_Toggle_HideIcon" IsChecked="{x:Bind ViewModel.EnabledOnContextMenu, Mode=TwoWay, Converter={StaticResource BoolNegationConverter}}" />
                            </tkcontrols:SettingsCard>
                        </tkcontrols:SettingsExpander.Items>
                    </tkcontrols:SettingsExpander>
                    <InfoBar
                        x:Uid="ExtendedContextMenuInfo"
                        IsClosable="False"
                        IsOpen="True"
                        IsTabStop="True"
                        Severity="Informational" />
                </controls:SettingsGroup>

                <controls:SettingsGroup x:Uid="PowerRename_AutoCompleteHeader" IsEnabled="{x:Bind ViewModel.IsEnabled, Mode=OneWay}">
                    <tkcontrols:SettingsExpander x:Uid="PowerRename_Toggle_AutoComplete" IsExpanded="True">
                        <ToggleSwitch x:Uid="ToggleSwitch" IsOn="{x:Bind ViewModel.MRUEnabled, Mode=TwoWay}" />
                        <tkcontrols:SettingsExpander.Items>
                            <tkcontrols:SettingsCard x:Uid="PowerRename_Toggle_MaxDispListNum" IsEnabled="{x:Bind ViewModel.GlobalAndMruEnabled, Mode=OneWay}">
                                <NumberBox
                                    MinWidth="{StaticResource SettingActionControlMinWidth}"
                                    Maximum="20"
                                    Minimum="0"
                                    SpinButtonPlacementMode="Compact"
                                    Value="{x:Bind ViewModel.MaxDispListNum, Mode=TwoWay}" />
                            </tkcontrols:SettingsCard>
                        </tkcontrols:SettingsExpander.Items>
                    </tkcontrols:SettingsExpander>

                    <tkcontrols:SettingsCard x:Uid="PowerRename_Toggle_RestoreFlagsOnLaunch" HeaderIcon="{ui:FontIcon Glyph=&#xe81c;}">
                        <ToggleSwitch x:Uid="ToggleSwitch" IsOn="{x:Bind ViewModel.RestoreFlagsOnLaunch, Mode=TwoWay}" />
                    </tkcontrols:SettingsCard>
                </controls:SettingsGroup>
                <controls:SettingsGroup x:Uid="PowerRename_BehaviorHeader" IsEnabled="{x:Bind ViewModel.IsEnabled, Mode=OneWay}">
                    <tkcontrols:SettingsCard x:Uid="PowerRename_Toggle_UseBoostLib">
                        <ToggleSwitch x:Uid="ToggleSwitch" IsOn="{x:Bind ViewModel.UseBoostLib, Mode=TwoWay}" />
                    </tkcontrols:SettingsCard>
                </controls:SettingsGroup>
            </StackPanel>
        </controls:SettingsPageControl.ModuleContent>

        <controls:SettingsPageControl.PrimaryLinks>
            <controls:PageLink x:Uid="LearnMore_PowerRename" Link="https://aka.ms/PowerToysOverview_PowerRename" />
        </controls:SettingsPageControl.PrimaryLinks>
        <controls:SettingsPageControl.SecondaryLinks>
            <controls:PageLink Link="https://github.com/chrdavis/SmartRename" Text="Chris Davis's SmartRenamer" />
        </controls:SettingsPageControl.SecondaryLinks>
    </controls:SettingsPageControl>
</Page>
