<local:SettingSectionControl
    x:Class="Bili.App.Controls.ThemeSettingSection"
    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:icons="using:Richasy.FluentIcon.Uwp"
    xmlns:labs="using:CommunityToolkit.Labs.WinUI"
    xmlns:loc="using:Bili.App.Resources.Extension"
    xmlns:local="using:Bili.App.Controls"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:muxc="using:Microsoft.UI.Xaml.Controls"
    d:DesignHeight="300"
    d:DesignWidth="400"
    mc:Ignorable="d">

    <labs:SettingsExpander Description="{loc:Locale Name=AppThemeDescription}" Header="{loc:Locale Name=AppTheme}">
        <labs:SettingsExpander.HeaderIcon>
            <icons:RegularFluentIcon Symbol="Color20" />
        </labs:SettingsExpander.HeaderIcon>
        <TextBlock FontWeight="Bold" Text="{x:Bind ViewModel.AppTheme, Mode=OneWay, Converter={StaticResource ThemeStringConverter}}" />
        <labs:SettingsExpander.Items>
            <labs:SettingsCard ContentAlignment="Left">
                <StackPanel>
                    <muxc:RadioButtons x:Name="ThemeRadioButtons" SelectionChanged="OnThemeRadioButtonSelectionChanged">
                        <RadioButton x:Name="LightThemeRadioButton" Content="{loc:Locale Name=Light}" />
                        <RadioButton x:Name="DarkThemeRadioButton" Content="{loc:Locale Name=Dark}" />
                        <RadioButton x:Name="SystemThemeRadioButton" Content="{loc:Locale Name=FollowSystem}" />
                    </muxc:RadioButtons>
                    <TextBlock
                        Style="{ThemeResource BodyTextBlockStyle}"
                        Margin="0,12,0,8"
                        FontSize="12"
                        Foreground="{ThemeResource SystemFillColorCautionBrush}"
                        Text="{loc:Locale Name=RestartWarning}"
                        Visibility="{x:Bind ViewModel.IsShowThemeRestartTip, Mode=OneWay}" />
                </StackPanel>
            </labs:SettingsCard>
        </labs:SettingsExpander.Items>
    </labs:SettingsExpander>
</local:SettingSectionControl>
