<Page x:Class="ModernFlyouts.Navigation.AudioModulePage"
      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:ModernFlyouts" xmlns:ui="http://schemas.modernwpf.com/2019"
      xmlns:toolkit="http://schemas.modernwpf.com/toolkit"
      xmlns:controls="clr-namespace:ModernFlyouts.Controls"
      xmlns:utils="clr-namespace:ModernFlyouts.Utilities"
      xmlns:resx="clr-namespace:ModernFlyouts.Properties"
      mc:Ignorable="d" 
      d:DesignHeight="450" d:DesignWidth="800" DataContext="{x:Static local:FlyoutHandler.Instance}">
    <controls:ScrollViewerEx VerticalScrollBarVisibility="Auto">
        <StackPanel Margin="20,10">
            <GroupBox>
                <ui:ToggleSwitch Header="{x:Static resx:Strings.Settings_EnableModule_Audio}"
                                 IsOn="{Binding AudioFlyoutHelper.IsEnabled}"
                                 OnContent="{x:Static resx:Strings.Settings_On}"
                                 OffContent="{x:Static resx:Strings.Settings_Off}" />
            </GroupBox>

            <TabControl IsEnabled="{Binding AudioFlyoutHelper.IsEnabled, Mode=OneWay}"
                        Margin="-10,0" Style="{DynamicResource TabControlPivotStyle}">
                <TabItem Header="{x:Static resx:Strings.GeneralSettings}">
                    <ui:SimpleStackPanel Margin="10" Spacing="10">
                        <ui:ToggleSwitch Header="{x:Static resx:Strings.AudioFlyoutHelper_ShowGSMTCInVolumeFlyout}"
                                         IsOn="{Binding AudioFlyoutHelper.ShowGSMTCInVolumeFlyout}"
                                         OnContent="{x:Static resx:Strings.Settings_On}"
                                         OffContent="{x:Static resx:Strings.Settings_Off}" />
                        <ui:ToggleSwitch Header="{x:Static resx:Strings.AudioFlyoutHelper_ShowVolumeControlInGSMTCFlyout}"
                                         IsOn="{Binding AudioFlyoutHelper.ShowVolumeControlInGSMTCFlyout}"
                                         OnContent="{x:Static resx:Strings.Settings_On}"
                                         OffContent="{x:Static resx:Strings.Settings_Off}" />
                    </ui:SimpleStackPanel>
                </TabItem>
                <TabItem Header="{x:Static resx:Strings.Settings_Modules_Audio_Media}">
                    <ui:SimpleStackPanel Margin="10" Spacing="10">
                        <ui:ToggleSwitch Header="{x:Static resx:Strings.AudioFlyoutHelper_ThumbnailAlignment}"
                                         OnContent="{x:Static resx:Strings.Settings_Right}" OffContent="{x:Static resx:Strings.Settings_Left}"
                                         IsOn="{Binding UIManager.AlignGSMTCThumbnailToRight}" />
                        <ui:ToggleSwitch Header="{x:Static resx:Strings.AudioFlyoutHelper_UseThumbnailAsBackground}"
                                         OnContent="{x:Static resx:Strings.Settings_On}" OffContent="{x:Static resx:Strings.Settings_Off}"
                                         IsOn="{Binding UIManager.UseGSMTCThumbnailAsBackground}" />
                        <ui:RadioButtons x:Name="orientationCmbBox" x:FieldModifier="private"
                                         Header="{x:Static resx:Strings.AudioFlyoutHelper_SessionsPanelOrientation}"
                                         ItemTemplate="{StaticResource LocalizedEnumItemTemplate}"
                                         ItemsSource="{toolkit:EnumValues Type=Orientation}"
                                         SelectedItem="{Binding UIManager.SessionsPanelOrientation}" />
                        <ui:NumberBox Header="{x:Static resx:Strings.AudioFlyoutHelper_MaxVerticalSessionControlsCount}" MinWidth="240"
                                      HorizontalAlignment="Left" Minimum="1" Maximum="10" SmallChange="1" LargeChange="2"
                                      SpinButtonPlacementMode="Inline" Value="{Binding UIManager.MaxVerticalSessionControlsCount}"
                                      Visibility="{Binding ElementName=orientationCmbBox, Path=SelectedIndex,
                                        Converter={StaticResource IndexToVisibilityConverter}, ConverterParameter=1}" />
                    </ui:SimpleStackPanel>
                </TabItem>
                <TabItem Header="{x:Static resx:Strings.Settings_Modules_Audio_Volume}" Visibility="Collapsed">

                </TabItem>
            </TabControl>
        </StackPanel>
    </controls:ScrollViewerEx>
</Page>
