<ui:Page xmlns:props="clr-namespace:Ink_Canvas.Properties" x:Class="Ink_Canvas.Windows.SettingsViews.Pages.RandomDrawPage"
      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:RandomStrings.Random_Title}">

    <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>
            <Grid>
                <ikw:SimpleStackPanel MaxWidth="1000"
                    HorizontalAlignment="Stretch"
                    Spacing="{StaticResource SettingsCardSpacing}">

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

                    <controls:LabeledSettingsCard x:Name="ToggleSwitchDisplayRandWindowNamesInputBtn"
                        Header="{x:Static props:RandomStrings.Random_ShowEditNamesButton}"
                        Icon="{x:Static ui:SegoeFluentIcons.Edit}"
                        IsOn="True"
                        Toggled="ToggleSwitchDisplayRandWindowNamesInputBtn_OnToggled"/>

                    <controls:LabeledSettingsCard x:Name="ToggleSwitchShowRandomAndSingleDraw"
                        Header="{x:Static props:RandomStrings.Random_EnableButtons}"
                        IsOn="True"
                        Toggled="ToggleSwitchShowRandomAndSingleDraw_Toggled"/>

                    <controls:LabeledSettingsCard x:Name="ToggleSwitchEnableQuickDraw"
                        Header="{x:Static props:RandomStrings.Random_EnableQuickButton}"
                        IsOn="True"
                        Toggled="ToggleSwitchEnableQuickDraw_Toggled"/>

                    <controls:LabeledSettingsCard x:Name="ToggleSwitchQuickDrawExternalCaller"
                        Header="{x:Static props:RandomStrings.Random_QuickDraw_UseExternal}"
                        IsOn="False"
                        Toggled="ToggleSwitchQuickDrawExternalCaller_Toggled"/>

                    <controls:LabeledSettingsCard x:Name="ToggleSwitchExternalCaller"
                        Header="{x:Static props:RandomStrings.Random_UseExternal}"
                        IsOn="False"
                        Toggled="ToggleSwitchExternalCaller_Toggled"/>

                    <ui:SettingsCard Header="{x:Static props:RandomStrings.Random_ExternalTypeLabel}">
                        <ComboBox x:Name="ComboBoxExternalCallerType"
                                  SelectedIndex="0"
                                  SelectionChanged="ComboBoxExternalCallerType_SelectionChanged">
                            <ComboBoxItem Content="{x:Static props:RandomStrings.Random_ExternalType_ClassIsland}" />
                            <ComboBoxItem Content="{x:Static props:RandomStrings.Random_ExternalType_SecRandom}" />
                            <ComboBoxItem Content="{x:Static props:RandomStrings.Random_ExternalType_NamePicker}" />
                        </ComboBox>
                    </ui:SettingsCard>

                    <ui:SettingsCard Header="{x:Static props:RandomStrings.Random_OnceCloseDelay}">
                        <ikw:SimpleStackPanel Orientation="Horizontal" Spacing="8">
                            <TextBlock x:Name="RandWindowOnceCloseLatencyText"
                                       VerticalAlignment="Center" FontFamily="Consolas" TextAlignment="Right"/>
                            <Slider x:Name="RandWindowOnceCloseLatencySlider"
                                    Minimum="0.5" Maximum="8" Width="200"
                                    IsSnapToTickEnabled="True" Value="2.5"
                                    TickFrequency="0.1" TickPlacement="None"
                                    ValueChanged="RandWindowOnceCloseLatencySlider_ValueChanged" />
                        </ikw:SimpleStackPanel>
                    </ui:SettingsCard>

                    <ui:SettingsCard Header="{x:Static props:RandomStrings.Random_OnceMaxStudents}">
                        <ikw:SimpleStackPanel Orientation="Horizontal" Spacing="8">
                            <TextBlock x:Name="RandWindowOnceMaxStudentsText"
                                       VerticalAlignment="Center" FontFamily="Consolas" TextAlignment="Right"/>
                            <Slider x:Name="RandWindowOnceMaxStudentsSlider"
                                    Minimum="0" Maximum="20" Width="200"
                                    IsSnapToTickEnabled="True" Value="10" TickFrequency="1"
                                    TickPlacement="None"
                                    ValueChanged="RandWindowOnceMaxStudentsSlider_ValueChanged" />
                        </ikw:SimpleStackPanel>
                    </ui:SettingsCard>

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

                    <ui:SettingsCard Header="{x:Static props:RandomStrings.Random_Roster_SelectLabel}">
                        <ikw:SimpleStackPanel Orientation="Horizontal" Spacing="8" VerticalAlignment="Center">
                            <Button x:Name="ButtonAddNameRoster" Content="{x:Static props:RandomStrings.Random_Roster_Add}" Click="ButtonAddNameRoster_Click" />
                            <Button x:Name="ButtonManageNameRosters" Content="{x:Static props:RandomStrings.Random_Roster_Manage}" Click="ButtonManageNameRosters_Click" />
                            <ComboBox x:Name="ComboBoxNameRoster"
                                      MinWidth="160"
                                      SelectedIndex="0"
                                      SelectionChanged="ComboBoxNameRoster_SelectionChanged" />
                        </ikw:SimpleStackPanel>
                    </ui:SettingsCard>

                    <TextBlock Text="{x:Static props:RandomStrings.Random_Roster_Hint}"
                               Foreground="{DynamicResource TextFillColorTertiaryBrush}"
                               TextWrapping="Wrap" Margin="1,0,0,4" />

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

                    <ui:SettingsCard Header="{x:Static props:RandomStrings.Random_BackgroundSelectLabel}">
                        <ikw:SimpleStackPanel Orientation="Horizontal" Spacing="8" VerticalAlignment="Center">
                            <Button x:Name="ButtonAddCustomBackground" Content="{x:Static props:ThemeStrings.Theme_Upload}" Click="ButtonAddCustomBackground_Click" />
                            <Button x:Name="ButtonManageBackgrounds" Content="{x:Static props:ThemeStrings.Theme_Manage}" Click="ButtonManageBackgrounds_Click" />
                            <ComboBox x:Name="ComboBoxPickNameBackground"
                                      SelectedIndex="0"
                                      SelectionChanged="ComboBoxPickNameBackground_SelectionChanged" />
                        </ikw:SimpleStackPanel>
                    </ui:SettingsCard>

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

                    <controls:LabeledSettingsCard x:Name="ToggleSwitchUseNewRollCallUI"
                        Header="{x:Static props:RandomStrings.Random_NewUI_Enable}"
                        IsOn="True"
                        Toggled="ToggleSwitchUseNewRollCallUI_Toggled"/>

                    <controls:LabeledSettingsCard x:Name="ToggleSwitchEnableMLAvoidance"
                        Header="{x:Static props:RandomStrings.Random_ML_AvoidRepeat}"
                        IsOn="True"
                        Toggled="ToggleSwitchEnableMLAvoidance_Toggled"/>

                    <ui:SettingsCard Header="{x:Static props:RandomStrings.Random_ML_HistoryCount}">
                        <ikw:SimpleStackPanel Orientation="Horizontal" Spacing="8">
                            <TextBlock x:Name="MLAvoidanceHistoryText"
                                       VerticalAlignment="Center" FontFamily="Consolas" TextAlignment="Right"/>
                            <Slider x:Name="MLAvoidanceHistorySlider"
                                    Minimum="5" Maximum="50" Width="200"
                                    IsSnapToTickEnabled="True" Value="50" TickFrequency="5"
                                    TickPlacement="None"
                                    ValueChanged="MLAvoidanceHistorySlider_ValueChanged" />
                        </ikw:SimpleStackPanel>
                    </ui:SettingsCard>

                    <ui:SettingsCard Header="{x:Static props:RandomStrings.Random_ML_Weight}">
                        <ikw:SimpleStackPanel Orientation="Horizontal" Spacing="8">
                            <TextBlock x:Name="MLAvoidanceWeightText"
                                       VerticalAlignment="Center" FontFamily="Consolas" TextAlignment="Right"/>
                            <Slider x:Name="MLAvoidanceWeightSlider"
                                    Minimum="0.1" Maximum="1.0" Width="200"
                                    IsSnapToTickEnabled="True" Value="1.0" TickFrequency="0.1"
                                    TickPlacement="None"
                                    ValueChanged="MLAvoidanceWeightSlider_ValueChanged" />
                        </ikw:SimpleStackPanel>
                    </ui:SettingsCard>

                    <TextBlock Text="{x:Static props:RandomStrings.Random_ML_Hint}"
                               Foreground="{DynamicResource TextFillColorTertiaryBrush}"
                               TextWrapping="Wrap" Margin="1,0,0,4" />

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

                    <ui:SettingsCard Header="{x:Static props:RandomStrings.Random_Title}">
                        <ComboBox x:Name="ComboBoxTimerUIStyle"
                                  SelectionChanged="ComboBoxTimerUIStyle_SelectionChanged">
                            <ComboBoxItem Content="{x:Static props:TimerStrings.Timer_UseLegacyButtons}" Tag="Legacy" />
                            <ComboBoxItem Content="{x:Static props:TimerStrings.Timer_NewUI}" Tag="NewStyle" />
                        </ComboBox>
                    </ui:SettingsCard>

                    <controls:LabeledSettingsCard x:Name="ToggleSwitchEnableOvertimeCountUp"
                        Header="{x:Static props:TimerStrings.Timer_EnableCountUp}"
                        IsOn="False"
                        Toggled="ToggleSwitchEnableOvertimeCountUp_Toggled"/>

                    <controls:LabeledSettingsCard x:Name="ToggleSwitchEnableOvertimeRedText"
                        Header="{x:Static props:TimerStrings.Timer_OvertimeHighlight}"
                        IsOn="True"
                        Toggled="ToggleSwitchEnableOvertimeRedText_Toggled"/>

                    <ui:SettingsCard Header="{x:Static props:TimerStrings.Timer_Volume}">
                        <ikw:SimpleStackPanel Orientation="Horizontal" Spacing="8">
                            <TextBlock x:Name="TimerVolumeText"
                                       VerticalAlignment="Center" FontFamily="Consolas" TextAlignment="Right"/>
                            <Slider x:Name="TimerVolumeSlider"
                                    Minimum="0" Maximum="1" Width="200"
                                    IsSnapToTickEnabled="True" Value="1" TickFrequency="0.1"
                                    TickPlacement="None"
                                    ValueChanged="TimerVolumeSlider_ValueChanged" />
                        </ikw:SimpleStackPanel>
                    </ui:SettingsCard>

                    <ui:SettingsCard Header="{x:Static props:TimerStrings.Timer_CustomSoundLabel}">
                        <ikw:SimpleStackPanel Orientation="Horizontal" Spacing="8">
                            <Button x:Name="ButtonSelectCustomTimerSound" Content="{x:Static props:TimerStrings.Timer_ProgressiveSelectFile}" Click="ButtonSelectCustomTimerSound_Click" />
                            <Button x:Name="ButtonResetTimerSound" Content="{x:Static props:TimerStrings.Timer_Reset}" Click="ButtonResetTimerSound_Click" />
                        </ikw:SimpleStackPanel>
                    </ui:SettingsCard>

                    <controls:LabeledSettingsCard x:Name="ToggleSwitchEnableProgressiveReminder"
                        Header="{x:Static props:TimerStrings.Timer_Progressive}"
                        IsOn="False"
                        Toggled="ToggleSwitchEnableProgressiveReminder_Toggled"/>

                    <ui:SettingsCard Header="{x:Static props:TimerStrings.Timer_ProgressiveVolume}">
                        <ikw:SimpleStackPanel Orientation="Horizontal" Spacing="8">
                            <TextBlock x:Name="ProgressiveReminderVolumeText"
                                       VerticalAlignment="Center" FontFamily="Consolas" TextAlignment="Right"/>
                            <Slider x:Name="ProgressiveReminderVolumeSlider"
                                    Minimum="0" Maximum="1" Width="200"
                                    IsSnapToTickEnabled="True" Value="1" TickFrequency="0.1"
                                    TickPlacement="None"
                                    ValueChanged="ProgressiveReminderVolumeSlider_ValueChanged" />
                        </ikw:SimpleStackPanel>
                    </ui:SettingsCard>

                    <ui:SettingsCard Header="{x:Static props:TimerStrings.Timer_ProgressiveCustomLabel}">
                        <ikw:SimpleStackPanel Orientation="Horizontal" Spacing="8">
                            <Button x:Name="ButtonSelectCustomProgressiveReminderSound" Content="{x:Static props:TimerStrings.Timer_ProgressiveSelectFile}" Click="ButtonSelectCustomProgressiveReminderSound_Click" />
                            <Button x:Name="ButtonResetProgressiveReminderSound" Content="{x:Static props:TimerStrings.Timer_Reset}" Click="ButtonResetProgressiveReminderSound_Click" />
                        </ikw:SimpleStackPanel>
                    </ui:SettingsCard>

                    <Rectangle Height="48" />

                </ikw:SimpleStackPanel>
            </Grid>
        </Grid>
    </ScrollViewer>
</ui:Page>
