<ui:Page xmlns:props="clr-namespace:Ink_Canvas.Properties" x:Class="Ink_Canvas.Windows.SettingsViews.Pages.NotificationPage"
      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:ui="http://schemas.inkore.net/lib/ui/wpf/modern"
      xmlns:ikw="http://schemas.inkore.net/lib/ui/wpf"
      xmlns:controls="clr-namespace:Ink_Canvas.Controls;assembly=InkCanvas.Controls"
      xmlns:c="clr-namespace:Ink_Canvas.Converter"
      xmlns:sys="clr-namespace:System;assembly=mscorlib"
      mc:Ignorable="d"
      Title="{x:Static props:NotificationStrings.DefaultTitle}">

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

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

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

                <controls:LabeledSettingsCard x:Name="CardEnableAnnouncements"
                        Header="{x:Static props:NotificationStrings.EnableAnnouncements}"
                        Description="{x:Static props:NotificationStrings.EnableAnnouncementsHint}"
                        Icon="{x:Static ui:SegoeFluentIcons.Message}"
                        Toggled="ToggleSwitchEnableAnnouncements_Toggled" />

                <controls:LabeledSettingsCard x:Name="CardEnableForcePopup"
                        Header="{x:Static props:NotificationStrings.EnableForcePopup}"
                        Description="{x:Static props:NotificationStrings.EnableForcePopupHint}"
                        Icon="{x:Static ui:SegoeFluentIcons.Warning}"
                        Toggled="ToggleSwitchEnableForcePopup_Toggled" />

                <ui:SettingsCard Header="{x:Static props:AnnouncementStrings.CenterTitle}"
                                 Description="{x:Static props:AnnouncementStrings.CenterHint}">
                    <ui:SettingsCard.HeaderIcon>
                        <ui:FontIcon Icon="{x:Static ui:SegoeFluentIcons.BulletedList}" />
                    </ui:SettingsCard.HeaderIcon>
                    <Button Content="{x:Static props:NotificationStrings.ViewHistory}"
                            Click="ViewAnnouncementsButton_Click" />
                </ui:SettingsCard>

                <controls:LabeledSettingsCard x:Name="CardEnableDynamic"
                        Header="{x:Static props:NotificationStrings.EnableDynamic}"
                        Description="{x:Static props:NotificationStrings.EnableDynamicHint}"
                        Icon="{x:Static ui:SegoeFluentIcons.Info}"
                        Toggled="ToggleSwitchEnableDynamic_Toggled" />

                <controls:LabeledSettingsCard x:Name="CardEnableWindowsToast"
                        Header="{x:Static props:NotificationStrings.EnableWindowsToast}"
                        Description="{x:Static props:NotificationStrings.EnableWindowsToastHint}"
                        Icon="{x:Static ui:SegoeFluentIcons.ActionCenterNotification}"
                        Toggled="ToggleSwitchEnableWindowsToast_Toggled" />

                <ui:SettingsExpander Header="{x:Static props:NotificationStrings.DictationDoNotDisturb}"
                                     Description="{x:Static props:NotificationStrings.DictationDoNotDisturbHint}"
                                     IsExpanded="{Binding IsOn, ElementName=ToggleSwitchDictationDoNotDisturb, Mode=OneWay}">
                    <ui:SettingsExpander.HeaderIcon>
                        <ui:FontIcon Icon="{x:Static ui:SegoeFluentIcons.BlockContact}" />
                    </ui:SettingsExpander.HeaderIcon>
                    <ui:SettingsExpander.Content>
                        <ui:ToggleSwitch x:Name="ToggleSwitchDictationDoNotDisturb"
                                      Toggled="ToggleSwitchDictationDoNotDisturb_Toggled" />
                    </ui:SettingsExpander.Content>
                    <ui:SettingsExpander.Items>
                        <ui:SettingsCard Header="{x:Static props:NotificationStrings.DictationDoNotDisturbPPT}"
                                         Description="{x:Static props:NotificationStrings.DictationDoNotDisturbPPTHint}">
                            <CheckBox x:Name="CheckBoxDictationDoNotDisturbPPT"
                                      Checked="DictationDoNotDisturbMode_CheckChanged"
                                      Unchecked="DictationDoNotDisturbMode_CheckChanged" />
                        </ui:SettingsCard>
                        <ui:SettingsCard Header="{x:Static props:NotificationStrings.DictationDoNotDisturbWhiteboard}"
                                         Description="{x:Static props:NotificationStrings.DictationDoNotDisturbWhiteboardHint}">
                            <CheckBox x:Name="CheckBoxDictationDoNotDisturbWhiteboard"
                                      Checked="DictationDoNotDisturbMode_CheckChanged"
                                      Unchecked="DictationDoNotDisturbMode_CheckChanged" />
                        </ui:SettingsCard>
                    </ui:SettingsExpander.Items>
                </ui:SettingsExpander>

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

                <ui:SettingsCard Header="{x:Static props:NotificationStrings.ProviderManagement}"
                                 Description="{x:Static props:NotificationStrings.ProviderManagementHint}">
                    <ui:SettingsCard.HeaderIcon>
                        <ui:FontIcon Icon="{x:Static ui:SegoeFluentIcons.Cloud}" />
                    </ui:SettingsCard.HeaderIcon>
                    <Button Content="{x:Static props:NotificationStrings.ProviderRefresh}"
                            Click="RefreshProvidersButton_Click" />
                </ui:SettingsCard>

                <ItemsControl x:Name="ProviderItemsControl">
                    <ItemsControl.ItemTemplate>
                        <DataTemplate>
                            <ui:SettingsCard Header="{Binding DisplayName}"
                                             Description="{Binding Description}">
                                <ui:SettingsCard.HeaderIcon>
                                    <ui:FontIcon Icon="{x:Static ui:SegoeFluentIcons.Cloud}" />
                                </ui:SettingsCard.HeaderIcon>
                                <StackPanel Orientation="Horizontal">
                                    <TextBlock Text="{Binding Status}" VerticalAlignment="Center" Margin="0,0,10,0" />
                                    <TextBlock Text="{Binding IsRunning}" VerticalAlignment="Center" Opacity="0.65" />
                                </StackPanel>
                            </ui:SettingsCard>
                        </DataTemplate>
                    </ItemsControl.ItemTemplate>
                </ItemsControl>

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

                <ui:SettingsCard Header="{x:Static props:NotificationStrings.Placement}"
                                 Description="{x:Static props:NotificationStrings.PlacementHint}">
                    <ui:SettingsCard.HeaderIcon>
                        <ui:FontIcon Icon="{x:Static ui:SegoeFluentIcons.POI}" />
                    </ui:SettingsCard.HeaderIcon>
                    <ComboBox x:Name="ComboBoxPlacement"
                              MinWidth="180"
                              SelectionChanged="ComboBoxPlacement_SelectionChanged">
                        <ComboBoxItem Content="{x:Static props:NotificationStrings.PlacementTopCenter}" Tag="TopCenter" />
                        <ComboBoxItem Content="{x:Static props:NotificationStrings.PlacementTopRight}" Tag="TopRight" />
                        <ComboBoxItem Content="{x:Static props:NotificationStrings.PlacementTopLeft}" Tag="TopLeft" />
                        <ComboBoxItem Content="{x:Static props:NotificationStrings.PlacementFloatingBarAbove}" Tag="FloatingBarAbove" />
                    </ComboBox>
                </ui:SettingsCard>

                <ui:SettingsCard Header="{x:Static props:NotificationStrings.AnimationMode}"
                                 Description="{x:Static props:NotificationStrings.AnimationModeHint}">
                    <ui:SettingsCard.HeaderIcon>
                        <ui:FontIcon Icon="{x:Static ui:SegoeFluentIcons.Play}"
                                     FontSize="16" />
                    </ui:SettingsCard.HeaderIcon>
                    <ComboBox x:Name="ComboBoxAnimationMode"
                              MinWidth="180"
                              SelectionChanged="ComboBoxAnimationMode_SelectionChanged">
                        <ComboBoxItem Content="{x:Static props:NotificationStrings.AnimationOff}" Tag="Off" />
                        <ComboBoxItem Content="{x:Static props:NotificationStrings.AnimationSimple}" Tag="Simple" />
                        <ComboBoxItem Content="{x:Static props:NotificationStrings.AnimationStandard}" Tag="Standard" />
                    </ComboBox>
                </ui:SettingsCard>

                <ui:SettingsCard Header="{x:Static props:NotificationStrings.UpdateDuration}"
                                 Description="{x:Static props:NotificationStrings.UpdateDurationHint}">
                    <ui:SettingsCard.HeaderIcon>
                        <ui:FontIcon Icon="{x:Static ui:SegoeFluentIcons.Sync}" />
                    </ui:SettingsCard.HeaderIcon>
                    <ikw:SimpleStackPanel Orientation="Horizontal" Spacing="8">
                        <TextBlock x:Name="UpdateDurationText" VerticalAlignment="Center" FontFamily="Consolas" />
                        <Slider x:Name="UpdateDurationSlider"
                                Width="220"
                                Minimum="1"
                                Maximum="60"
                                TickFrequency="1"
                                IsSnapToTickEnabled="True"
                                ValueChanged="UpdateDurationSlider_ValueChanged" />
                    </ikw:SimpleStackPanel>
                </ui:SettingsCard>

                <ui:SettingsCard Header="{x:Static props:NotificationStrings.UrgentDuration}"
                                 Description="{x:Static props:NotificationStrings.UrgentDurationHint}">
                    <ui:SettingsCard.HeaderIcon>
                        <ui:FontIcon Icon="{x:Static ui:SegoeFluentIcons.Warning}" />
                    </ui:SettingsCard.HeaderIcon>
                    <ikw:SimpleStackPanel Orientation="Horizontal" Spacing="8">
                        <TextBlock x:Name="UrgentDurationText" VerticalAlignment="Center" FontFamily="Consolas" />
                        <Slider x:Name="UrgentDurationSlider"
                                Width="220"
                                Minimum="3"
                                Maximum="60"
                                TickFrequency="1"
                                IsSnapToTickEnabled="True"
                                ValueChanged="UrgentDurationSlider_ValueChanged" />
                    </ikw:SimpleStackPanel>
                </ui:SettingsCard>

                <ui:SettingsCard Header="{x:Static props:NotificationStrings.ImportantDuration}"
                                 Description="{x:Static props:NotificationStrings.ImportantDurationHint}">
                    <ui:SettingsCard.HeaderIcon>
                        <ui:FontIcon Icon="{x:Static ui:SegoeFluentIcons.Important}" />
                    </ui:SettingsCard.HeaderIcon>
                    <ikw:SimpleStackPanel Orientation="Horizontal" Spacing="8">
                        <TextBlock x:Name="ImportantDurationText" VerticalAlignment="Center" FontFamily="Consolas" />
                        <Slider x:Name="ImportantDurationSlider"
                                Width="220"
                                Minimum="3"
                                Maximum="60"
                                TickFrequency="1"
                                IsSnapToTickEnabled="True"
                                ValueChanged="ImportantDurationSlider_ValueChanged" />
                    </ikw:SimpleStackPanel>
                </ui:SettingsCard>

                <ui:SettingsCard Header="{x:Static props:NotificationStrings.ReminderDuration}"
                                 Description="{x:Static props:NotificationStrings.ReminderDurationHint}">
                    <ui:SettingsCard.HeaderIcon>
                        <ui:FontIcon Icon="{x:Static ui:SegoeFluentIcons.Stopwatch}" />
                    </ui:SettingsCard.HeaderIcon>
                    <ikw:SimpleStackPanel Orientation="Horizontal" Spacing="8">
                        <TextBlock x:Name="ReminderDurationText" VerticalAlignment="Center" FontFamily="Consolas" />
                        <Slider x:Name="ReminderDurationSlider"
                                Width="220"
                                Minimum="3"
                                Maximum="60"
                                TickFrequency="1"
                                IsSnapToTickEnabled="True"
                                ValueChanged="ReminderDurationSlider_ValueChanged" />
                    </ikw:SimpleStackPanel>
                </ui:SettingsCard>

                <ui:SettingsCard Header="{x:Static props:NotificationStrings.OtherDuration}"
                                 Description="{x:Static props:NotificationStrings.OtherDurationHint}">
                    <ui:SettingsCard.HeaderIcon>
                        <ui:FontIcon Icon="{x:Static ui:SegoeFluentIcons.Info}" />
                    </ui:SettingsCard.HeaderIcon>
                    <ikw:SimpleStackPanel Orientation="Horizontal" Spacing="8">
                        <TextBlock x:Name="OtherDurationText" VerticalAlignment="Center" FontFamily="Consolas" />
                        <Slider x:Name="OtherDurationSlider"
                                Width="220"
                                Minimum="1"
                                Maximum="60"
                                TickFrequency="1"
                                IsSnapToTickEnabled="True"
                                ValueChanged="OtherDurationSlider_ValueChanged" />
                    </ikw:SimpleStackPanel>
                </ui:SettingsCard>

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

                <ui:SettingsCard Header="{x:Static props:NotificationStrings.Test}"
                                 Description="{x:Static props:NotificationStrings.TestHint}">
                    <ui:SettingsCard.HeaderIcon>
                        <ui:FontIcon Icon="{x:Static ui:SegoeFluentIcons.Send}" />
                    </ui:SettingsCard.HeaderIcon>
                    <Button Content="{x:Static props:NotificationStrings.TestButton}"
                            Click="TestNotificationButton_Click" />
                </ui:SettingsCard>

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