<ui:Page xmlns:props="clr-namespace:Ink_Canvas.Properties" x:Class="Ink_Canvas.Windows.SettingsViews.Pages.DebugPage"
      xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
      xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
      xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
      xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
      xmlns:local="clr-namespace:Ink_Canvas.Windows.SettingsViews.Pages"
      xmlns:ui="http://schemas.inkore.net/lib/ui/wpf/modern"
      xmlns:ikw="http://schemas.inkore.net/lib/ui/wpf"
      xmlns:sys="clr-namespace:System;assembly=mscorlib"
      xmlns:controls="clr-namespace:Ink_Canvas.Controls;assembly=InkCanvas.Controls"
mc:Ignorable="d"
      Title="{x:Static props:AdvancedStrings.Debug_PageTitle}">

    <ScrollViewer PanningMode="VerticalFirst">
        <Grid Margin="59,0,59,0">
            <FrameworkElement.Resources>
                <sys:Double x:Key="SettingsCardSpacing">4</sys:Double>
                <Style x:Key="SettingsSectionHeaderTextBlockStyle"
                    BasedOn="{StaticResource BodyStrongTextBlockStyle}"
                    TargetType="TextBlock">
                    <Style.Setters>
                        <Setter Property="Margin" Value="1,30,0,6" />
                    </Style.Setters>
                </Style>
            </FrameworkElement.Resources>

            <ikw:SimpleStackPanel MaxWidth="1000"
                HorizontalAlignment="Stretch"
                Spacing="{StaticResource SettingsCardSpacing}">

                <TextBlock Style="{StaticResource SettingsSectionHeaderTextBlockStyle}"
                    Text="{x:Static props:AdvancedStrings.Debug_PageHeader}" />

                <controls:LabeledSettingsCard x:Name="ToggleSwitchDebugConsole"
                    Header="{x:Static props:AdvancedStrings.Debug_ShowConsole_Header}"
                    Description="{x:Static props:AdvancedStrings.Debug_ShowConsole_Desc}"
                    Icon="{x:Static ui:SegoeFluentIcons.DeveloperTools}"
                    IsOn="False"
                    Toggled="ToggleSwitchDebugConsole_Toggled"/>

                <controls:LabeledSettingsCard x:Name="ToggleSwitchPPTComDebugProbe"
                    Header="{x:Static props:AdvancedStrings.Debug_PPTComProbe_Header}"
                    Description="{x:Static props:AdvancedStrings.Debug_PPTComProbe_Desc}"
                    Icon="{x:Static ui:SegoeFluentIcons.Bug}"
                    IsOn="False"
                    Toggled="ToggleSwitchPPTComDebugProbe_Toggled"/>

                <controls:LabeledSettingsCard x:Name="ToggleSwitchPPTPageFlipPreview"
                    Header="{x:Static props:AdvancedStrings.Debug_PPTPreviewVisible_Header}"
                    Description="{x:Static props:AdvancedStrings.Debug_PPTPreviewVisible_Desc}"
                    Icon="{x:Static ui:SegoeFluentIcons.View}"
                    IsOn="False" d:IsOn="True"
                    Toggled="ToggleSwitchPPTPageFlipPreview_Toggled"/>

                <controls:LabeledSettingsCard x:Name="ToggleSwitchRealtimeInkDebugLog"
                    Header="{x:Static props:AdvancedStrings.Debug_RealtimeInkLog_Header}"
                    Description="{x:Static props:AdvancedStrings.Debug_RealtimeInkLog_Desc}"
                    Icon="{x:Static ui:SegoeFluentIcons.SpeedHigh}"
                    IsOn="False"
                    Toggled="ToggleSwitchRealtimeInkDebugLog_Toggled"/>

                <controls:LabeledSettingsCard x:Name="ToggleSwitchRealtimeInkFpsOverlay"
                    Header="{x:Static props:AdvancedStrings.Debug_RealtimeInkFpsOverlay_Header}"
                    Description="{x:Static props:AdvancedStrings.Debug_RealtimeInkFpsOverlay_Desc}"
                    IsOn="False"
                    Toggled="ToggleSwitchRealtimeInkFpsOverlay_Toggled">
                    <controls:LabeledSettingsCard.HeaderIcon>
                        <ui:FontIcon Glyph="&#xE9D2;"/>
                    </controls:LabeledSettingsCard.HeaderIcon>
                </controls:LabeledSettingsCard>

                <TextBlock Style="{StaticResource SettingsSectionHeaderTextBlockStyle}"
                    Text="{x:Static props:AdvancedStrings.Debug_CrashTest_Section}" />

                <ui:SettingsCard Header="{x:Static props:AdvancedStrings.Debug_SimulateCrash_Header}"
                    Description="{x:Static props:AdvancedStrings.Debug_SimulateCrash_Desc}">
                    <ui:SettingsCard.HeaderIcon>
                        <ui:FontIcon Icon="{x:Static ui:SegoeFluentIcons.Error}"/>
                    </ui:SettingsCard.HeaderIcon>
                    <Button Content="{x:Static props:AdvancedStrings.Debug_SimulateCrash_Button}" Click="BtnTestCrash_Click"
                        Style="{DynamicResource AccentButtonStyle}"
                        Padding="14,6"/>
                </ui:SettingsCard>

                <ui:SettingsCard Header="{x:Static props:AdvancedStrings.Debug_SimulateHeartbeatTimeout_Header}"
                    Description="{x:Static props:AdvancedStrings.Debug_SimulateHeartbeatTimeout_Desc}">
                    <ui:SettingsCard.HeaderIcon>
                        <ui:FontIcon Icon="{x:Static ui:SegoeFluentIcons.Stopwatch}"/>
                    </ui:SettingsCard.HeaderIcon>
                    <Button Content="{x:Static props:AdvancedStrings.Debug_SimulateHeartbeatTimeout_Button}" Click="BtnTestHeartbeatTimeout_Click"
                        Padding="14,6"/>
                </ui:SettingsCard>

                <ui:SettingsCard Header="{x:Static props:AdvancedStrings.Debug_ResetStartupCount_Header}"
                    Description="{x:Static props:AdvancedStrings.Debug_ResetStartupCount_Desc}">
                    <ui:SettingsCard.HeaderIcon>
                        <ui:FontIcon Icon="{x:Static ui:SegoeFluentIcons.Sync}"/>
                    </ui:SettingsCard.HeaderIcon>
                    <Button Content="{x:Static props:AdvancedStrings.Debug_ResetStartupCount_Button}" Click="BtnResetStartupCount_Click"
                        Padding="14,6"/>
                </ui:SettingsCard>

                <TextBlock Style="{StaticResource SettingsSectionHeaderTextBlockStyle}"
                    Text="{x:Static props:AdvancedStrings.Debug_MemoryBreakdownSection}" />

                <ui:SettingsCard Header="{x:Static props:AdvancedStrings.Debug_MemoryBreakdownDump_Header}"
                    Description="{x:Static props:AdvancedStrings.Debug_MemoryBreakdownDump_Desc}">
                    <ui:SettingsCard.HeaderIcon>
                        <ui:FontIcon Icon="{x:Static ui:SegoeFluentIcons.Save}"/>
                    </ui:SettingsCard.HeaderIcon>
                    <Button x:Name="BtnDumpMemory"
                        Content="{x:Static props:AdvancedStrings.Debug_MemoryBreakdownDump_Button}"
                        Click="BtnDumpMemory_Click"
                        Padding="14,6"/>
                </ui:SettingsCard>

                <ui:SettingsCard Header="{x:Static props:AdvancedStrings.Debug_MemoryBreakdownForceGC_Header}"
                    Description="{x:Static props:AdvancedStrings.Debug_MemoryBreakdownForceGC_Desc}">
                    <ui:SettingsCard.HeaderIcon>
                        <ui:FontIcon Icon="{x:Static ui:SegoeFluentIcons.Broom}"/>
                    </ui:SettingsCard.HeaderIcon>
                    <Button x:Name="BtnForceGC"
                        Content="{x:Static props:AdvancedStrings.Debug_MemoryBreakdownForceGC_Button}"
                        Click="BtnForceGC_Click"
                        Padding="14,6"/>
                </ui:SettingsCard>

                <TextBlock Style="{StaticResource SettingsSectionHeaderTextBlockStyle}"
                    Text="{x:Static props:AdvancedStrings.Debug_IconSettings}" />

                <ui:SettingsExpander Header="{x:Static props:AdvancedStrings.Debug_SettingsExpanderExample}" IsEnabled="True"
                    IsExpanded="True"
                    d:Visibility="Visible" d:IsExpanded="True">

                    <ui:SettingsExpander.HeaderIcon>
                        <ui:FontIcon Glyph="&#xE91B;"/>
                    </ui:SettingsExpander.HeaderIcon>

                    <controls:CopyButton Text="{x:Static props:AdvancedStrings.Debug_SettingsExpanderExample_Desc}"/>

                    <ui:SettingsExpander.Items>
                        <ui:SettingsCard Description="{x:Static props:AdvancedStrings.Debug_SettingsExpanderExample_Desc}"
                            Header="{x:Static props:AdvancedStrings.Debug_SettingsExpanderExample_Header}">
                            <ui:SettingsCard.Resources>
                                <sys:Double x:Key="SettingsCardLeftIndention">0</sys:Double>
                            </ui:SettingsCard.Resources>
                        </ui:SettingsCard>
                    </ui:SettingsExpander.Items>
                </ui:SettingsExpander>

                <Rectangle Height="48" />
            </ikw:SimpleStackPanel>
        </Grid>
    </ScrollViewer>
</ui:Page>