<Page
    x:Class="Microsoft.PowerToys.Settings.UI.Views.MeasureToolPage"
    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="MeasureTool" ModuleImageSource="ms-appx:///Assets/Settings/Modules/ScreenRuler.png">
        <controls:SettingsPageControl.ModuleContent>
            <StackPanel ChildrenTransitions="{StaticResource SettingsCardsAnimations}" Orientation="Vertical">
                <tkcontrols:SettingsCard
                    x:Uid="MeasureTool_EnableMeasureTool"
                    HeaderIcon="{ui:BitmapIcon Source=/Assets/Settings/Icons/ScreenRuler.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="MeasureTool_ActivationSettings" IsEnabled="{x:Bind ViewModel.IsEnabled, Mode=OneWay}">
                    <tkcontrols:SettingsCard x:Uid="MeasureTool_ActivationShortcut" HeaderIcon="{ui:FontIcon Glyph=&#xEDA7;}">
                        <controls:ShortcutControl MinWidth="{StaticResource SettingActionControlMinWidth}" HotkeySettings="{x:Bind Path=ViewModel.ActivationShortcut, Mode=TwoWay}" />
                    </tkcontrols:SettingsCard>
                    <tkcontrols:SettingsCard x:Uid="MeasureTool_DefaultMeasureStyle">
                        <ComboBox MinWidth="{StaticResource SettingActionControlMinWidth}" SelectedIndex="{x:Bind Path=ViewModel.DefaultMeasureStyle, Mode=TwoWay}">
                            <ComboBoxItem x:Uid="MeasureTool_DefaultMeasureStyle_None" />
                            <ComboBoxItem x:Uid="MeasureTool_DefaultMeasureStyle_Bounds" />
                            <ComboBoxItem x:Uid="MeasureTool_DefaultMeasureStyle_Spacing" />
                            <ComboBoxItem x:Uid="MeasureTool_DefaultMeasureStyle_Horizontal_Spacing" />
                            <ComboBoxItem x:Uid="MeasureTool_DefaultMeasureStyle_Vertical_Spacing" />
                        </ComboBox>
                    </tkcontrols:SettingsCard>

                </controls:SettingsGroup>

                <controls:SettingsGroup x:Uid="MeasureTool_Settings" IsEnabled="{x:Bind ViewModel.IsEnabled, Mode=OneWay}">
                    <tkcontrols:SettingsCard x:Uid="MeasureTool_ContinuousCapture" HeaderIcon="{ui:FontIcon Glyph=&#xE7FB;}">
                        <ToggleSwitch x:Uid="MeasureTool_ContinuousCapture_ToggleSwitch" IsOn="{x:Bind ViewModel.ContinuousCapture, Mode=TwoWay}" />
                    </tkcontrols:SettingsCard>
                    <InfoBar
                        x:Uid="MeasureTool_ContinuousCapture_Information"
                        IsClosable="False"
                        IsOpen="{x:Bind ViewModel.ShowContinuousCaptureWarning, Mode=OneWay}"
                        IsTabStop="{x:Bind ViewModel.ShowContinuousCaptureWarning, Mode=OneWay}"
                        Severity="Warning" />

                    <tkcontrols:SettingsCard x:Uid="MeasureTool_PerColorChannelEdgeDetection" HeaderIcon="{ui:FontIcon Glyph=&#xE7FB;}">
                        <ToggleSwitch x:Uid="MeasureTool_PerColorChannelEdgeDetection_ToggleSwitch" IsOn="{x:Bind ViewModel.PerColorChannelEdgeDetection, Mode=TwoWay}" />
                    </tkcontrols:SettingsCard>

                    <tkcontrols:SettingsCard x:Uid="MeasureTool_PixelTolerance">
                        <Slider
                            MinWidth="{StaticResource SettingActionControlMinWidth}"
                            Maximum="255"
                            Minimum="0"
                            Value="{x:Bind ViewModel.PixelTolerance, Mode=TwoWay}" />
                    </tkcontrols:SettingsCard>

                    <!--<tkcontrols:SettingsCard x:Uid="MeasureTool_UnitsOfMeasure" HeaderIcon="{ui:FontIcon Glyph=&#xECC6;}">
                        <ComboBox SelectedIndex="{x:Bind Path=ViewModel.UnitsOfMeasure, Mode=TwoWay}" MinWidth="{StaticResource SettingActionControlMinWidth}">
                            <ComboBoxItem x:Uid="MeasureTool_UnitsOfMeasure_Pixels" />
                            <ComboBoxItem x:Uid="MeasureTool_UnitsOfMeasure_Inches" />
                            <ComboBoxItem x:Uid="MeasureTool_UnitsOfMeasure_Centimeters" />
                        </ComboBox>
                    </tkcontrols:SettingsCard>-->

                    <tkcontrols:SettingsCard x:Uid="MeasureTool_DrawFeetOnCross">
                        <ToggleSwitch x:Uid="MeasureTool_DrawFeetOnCross_ToggleSwitch" IsOn="{x:Bind ViewModel.DrawFeetOnCross, Mode=TwoWay}" />
                    </tkcontrols:SettingsCard>

                    <tkcontrols:SettingsCard x:Uid="MeasureTool_MeasureCrossColor">
                        <controls:ColorPickerButton SelectedColor="{x:Bind Path=ViewModel.CrossColor, Mode=TwoWay}" />
                    </tkcontrols:SettingsCard>
                </controls:SettingsGroup>
            </StackPanel>
        </controls:SettingsPageControl.ModuleContent>
        <controls:SettingsPageControl.PrimaryLinks>
            <controls:PageLink x:Uid="LearnMore_MeasureTool" Link="https://aka.ms/PowerToysOverview_ScreenRuler" />
        </controls:SettingsPageControl.PrimaryLinks>
        <controls:SettingsPageControl.SecondaryLinks>
            <controls:PageLink x:Uid="Attribution_Rooler" Link="https://github.com/peteblois/rooler" />
        </controls:SettingsPageControl.SecondaryLinks>
    </controls:SettingsPageControl>
</Page>
