<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:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:controls="using:Microsoft.PowerToys.Settings.UI.Controls"
    xmlns:muxc="using:Microsoft.UI.Xaml.Controls" xmlns:converters="using:Microsoft.Toolkit.Uwp.UI.Converters"
    mc:Ignorable="d"
    AutomationProperties.LandmarkType="Main">
    <Page.Resources>
        <converters:BoolToObjectConverter x:Key="BoolToComboBoxIndexConverter" TrueValue="1" FalseValue="0"/>
        <converters:BoolNegationConverter x:Key="BoolNegationConverter" />
    </Page.Resources>
    <controls:SettingsPageControl x:Uid="PowerRename"
                                  ModuleImageSource="ms-appx:///Assets/Modules/PowerRename.png">
        <controls:SettingsPageControl.ModuleContent>
            <StackPanel Orientation="Vertical"
                    x:Name="PowerRenameView"
                    HorizontalAlignment="Stretch">

                <controls:Setting x:Uid="PowerRename_Toggle_Enable">
                    <controls:Setting.Icon>
                        <BitmapIcon UriSource="ms-appx:///Assets/FluentIcons/FluentIconsPowerRename.png" ShowAsMonochrome="False" />
                    </controls:Setting.Icon>
                    <controls:Setting.ActionContent>
                        <ToggleSwitch IsOn="{x:Bind Mode=TwoWay, Path=ViewModel.IsEnabled}" x:Uid="ToggleSwitch"/>
                    </controls:Setting.ActionContent>
                </controls:Setting>

                <controls:SettingsGroup x:Uid="PowerRename_ShellIntegration" IsEnabled="{x:Bind Mode=OneWay, Path=ViewModel.IsEnabled}">
                    <controls:SettingExpander IsExpanded="True">
                        <controls:SettingExpander.Header>
                            <controls:Setting x:Uid="PowerRename_Toggle_ContextMenu" Style="{StaticResource ExpanderHeaderSettingStyle}">
                                <controls:Setting.ActionContent>
                                    <ComboBox SelectedIndex="{x:Bind Mode=TwoWay, Path=ViewModel.EnabledOnContextExtendedMenu, Converter={StaticResource BoolToComboBoxIndexConverter}}" MinWidth="{StaticResource SettingActionControlMinWidth}">
                                        <ComboBoxItem x:Uid="PowerRename_Toggle_StandardContextMenu" />
                                        <ComboBoxItem x:Uid="PowerRename_Toggle_ExtendedContextMenu" />
                                    </ComboBox>
                                </controls:Setting.ActionContent>
                            </controls:Setting>
                        </controls:SettingExpander.Header>
                        <controls:SettingExpander.Content>
                            <StackPanel HorizontalAlignment="Stretch">
                                <CheckBox x:Uid="PowerRename_Toggle_HideIcon"
                                          IsChecked="{x:Bind Mode=TwoWay, Path=ViewModel.EnabledOnContextMenu, Converter={StaticResource BoolNegationConverter}}"
                                          Margin="{StaticResource ExpanderSettingMargin}"/>
                            </StackPanel>
                        </controls:SettingExpander.Content>
                    </controls:SettingExpander>
                </controls:SettingsGroup>

                <controls:SettingsGroup x:Uid="PowerRename_AutoCompleteHeader" IsEnabled="{x:Bind Mode=OneWay, Path=ViewModel.IsEnabled}">
                    <controls:SettingExpander IsExpanded="True">
                        <controls:SettingExpander.Header>
                            <controls:Setting x:Uid="PowerRename_Toggle_AutoComplete" Style="{StaticResource ExpanderHeaderSettingStyle}">
                                <controls:Setting.ActionContent>
                                    <ToggleSwitch IsOn="{x:Bind Mode=TwoWay, Path=ViewModel.MRUEnabled}" x:Uid="ToggleSwitch"/>
                                </controls:Setting.ActionContent>
                            </controls:Setting>
                        </controls:SettingExpander.Header>
                        <controls:SettingExpander.Content>
                            <StackPanel HorizontalAlignment="Stretch">
                                <controls:Setting x:Uid="PowerRename_Toggle_MaxDispListNum"
                                                  Style="{StaticResource ExpanderContentSettingStyle}"
                                                  IsEnabled="{x:Bind Mode=OneWay, Path=ViewModel.GlobalAndMruEnabled}">
                                    <controls:Setting.ActionContent>
                                        <muxc:NumberBox SpinButtonPlacementMode="Compact"
                                            HorizontalAlignment="Left"
                                            Value="{x:Bind Mode=TwoWay, Path=ViewModel.MaxDispListNum}"
                                            Minimum="0"
                                            Maximum="20"
                                            MinWidth="{StaticResource SettingActionControlMinWidth}"/>  
                                    </controls:Setting.ActionContent>
                                </controls:Setting>
                            </StackPanel>
                        </controls:SettingExpander.Content>
                    </controls:SettingExpander>
                    <controls:Setting x:Uid="PowerRename_Toggle_RestoreFlagsOnLaunch">
                        <controls:Setting.ActionContent>
                            <ToggleSwitch IsOn="{x:Bind Mode=TwoWay, Path=ViewModel.RestoreFlagsOnLaunch}" x:Uid="ToggleSwitch"/>
                        </controls:Setting.ActionContent>
                    </controls:Setting>
                </controls:SettingsGroup>
              

                <controls:SettingsGroup x:Uid="PowerRename_BehaviorHeader" IsEnabled="{x:Bind Mode=OneWay, Path=ViewModel.IsEnabled}">
                    <controls:Setting x:Uid="PowerRename_Toggle_UseBoostLib">
                        <controls:Setting.ActionContent>
                            <ToggleSwitch IsOn="{x:Bind Mode=TwoWay, Path=ViewModel.UseBoostLib}" x:Uid="ToggleSwitch"/>
                        </controls:Setting.ActionContent>
                    </controls:Setting>
                </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 Text="Chris Davis's SmartRenamer" Link="https://github.com/chrdavis/SmartRename"/>
        </controls:SettingsPageControl.SecondaryLinks>
    </controls:SettingsPageControl>
</Page>
