<Page
    x:Class="WinPrint.Views.SettingsPage"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:helper="using:WinPrint.Helpers"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    Style="{StaticResource PageStyle}"
    xmlns:xaml="using:Windows.UI.Xaml"
    mc:Ignorable="d">
    <Page.Resources>
        <helper:EnumToBooleanConverter x:Key="EnumToBooleanConverter" EnumType="ElementTheme" />
    </Page.Resources>

    <Grid Margin="{StaticResource MediumLeftRightMargin}">
        <StackPanel
            x:Name="ContentArea">
            <TextBlock x:Uid="Settings_Personalization" Style="{ThemeResource SubtitleTextBlockStyle}" />
            <StackPanel Margin="{StaticResource SmallTopBottomMargin}">
                <TextBlock x:Uid="Settings_Theme" />

                <StackPanel Margin="{StaticResource XSmallTopMargin}">
                    <RadioButton
                        x:Uid="Settings_Theme_Light"
                        Command="{x:Bind ViewModel.SwitchThemeCommand}"
                        IsChecked="{x:Bind ViewModel.ElementTheme, Converter={StaticResource EnumToBooleanConverter}, ConverterParameter=Light, Mode=OneWay}"
                        FontSize="15"
                        GroupName="AppTheme">
                        <RadioButton.CommandParameter>
                            <xaml:ElementTheme>Light</xaml:ElementTheme>
                        </RadioButton.CommandParameter>
                    </RadioButton>
                    <RadioButton
                        x:Uid="Settings_Theme_Dark"
                        Command="{x:Bind ViewModel.SwitchThemeCommand}"
                        IsChecked="{x:Bind ViewModel.ElementTheme, Converter={StaticResource EnumToBooleanConverter}, ConverterParameter=Dark, Mode=OneWay}"
                        FontSize="15"
                        GroupName="AppTheme">
                        <RadioButton.CommandParameter>
                            <xaml:ElementTheme>Dark</xaml:ElementTheme>
                        </RadioButton.CommandParameter>
                    </RadioButton>
                    <RadioButton
                        x:Uid="Settings_Theme_Default"
                        Command="{x:Bind ViewModel.SwitchThemeCommand}"
                        IsChecked="{x:Bind ViewModel.ElementTheme, Converter={StaticResource EnumToBooleanConverter}, ConverterParameter=Default, Mode=OneWay}"
                        FontSize="15"
                        GroupName="AppTheme">
                        <RadioButton.CommandParameter>
                            <xaml:ElementTheme>Default</xaml:ElementTheme>
                        </RadioButton.CommandParameter>
                    </RadioButton>
                </StackPanel>
            </StackPanel>

            <TextBlock x:Uid="Settings_About" Style="{ThemeResource SubtitleTextBlockStyle}" />

            <StackPanel Margin="{StaticResource XSmallTopMargin}">
                <TextBlock Style="{ThemeResource BodyTextBlockStyle}" Text="{x:Bind ViewModel.VersionDescription, Mode=OneWay}" />
                <TextBlock
                    x:Uid="Settings_AboutDescription"
                    Margin="{StaticResource XSmallTopMargin}"
                    Style="{ThemeResource BodyTextBlockStyle}" />

                <HyperlinkButton x:Uid="Settings_PrivacyTermsLink" Margin="{StaticResource XSmallTopMargin}" />
            </StackPanel>
        </StackPanel>
    </Grid>    
</Page>
