<ResourceDictionary
    x:ClassModifier="internal"
    xmlns="https://github.com/avaloniaui"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
    <ControlTheme TargetType="RadioButton" x:Key="{x:Type RadioButton}">
        <Setter Property="Background" Value="Transparent" />
        <Setter Property="BorderBrush" Value="{DynamicResource MainBorderColor}" />
        <Setter Property="BorderThickness" Value="1" />

        <Setter Property="Template">
            <ControlTemplate>
                <Grid Background="{TemplateBinding Background}" ColumnDefinitions="Auto,*">
                    <Border
                        Background="{DynamicResource TertiaryBackgroundColor}"
                        BorderBrush="{TemplateBinding BorderBrush}"
                        BorderThickness="1"
                        CornerRadius="6"
                        Height="18"
                        Name="border"
                        VerticalAlignment="Center"
                        Width="18" />
                    <Ellipse
                        Fill="#fff"
                        Grid.Column="0"
                        Height="10"
                        HorizontalAlignment="Center"
                        IsVisible="False"
                        Name="checkMark"
                        Stretch="Uniform"
                        VerticalAlignment="Center"
                        Width="10" />
                    <Border
                        Background="Transparent"
                        CornerRadius="6"
                        Grid.Column="0"
                        Height="10"
                        HorizontalAlignment="Center"
                        Name="indeterminateMark"
                        UseLayoutRounding="False"
                        VerticalAlignment="Center"
                        Width="10" />
                    <ContentPresenter
                        Content="{TemplateBinding Content}"
                        ContentTemplate="{TemplateBinding ContentTemplate}"
                        Grid.Column="1"
                        Margin="6,0,0,0"
                        Name="PART_ContentPresenter"
                        RecognizesAccessKey="True"
                        VerticalAlignment="Center" />
                </Grid>
            </ControlTemplate>
        </Setter>

        <Style Selector="^:pointerover /template/ Border#border">
            <Setter Property="BorderBrush" Value="{DynamicResource SecondaryBorderColor}" />
        </Style>
        <Style Selector="^:checked /template/ Border#border">
            <Setter Property="Background" Value="{DynamicResource AccentColor}" />
        </Style>

        <Style Selector="^ /template/ Border#indeterminateMark">
            <Setter Property="IsVisible" Value="False" />
        </Style>
        <Style Selector="^:checked /template/ Ellipse#checkMark">
            <Setter Property="IsVisible" Value="True" />
        </Style>
        <Style Selector="^:indeterminate /template/ Border#indeterminateMark">
            <Setter Property="IsVisible" Value="True" />
        </Style>
        <Style Selector="^:disabled /template/ Border#border">
            <Setter Property="Opacity" Value="{StaticResource ThemeDisabledOpacity}" />
        </Style>
    </ControlTheme>

    <ControlTheme TargetType="RadioButton" x:Key="NoneTemplate">
        <Setter Property="Template">
            <ControlTemplate>
                <Panel Background="{TemplateBinding Background}">

                    <ContentPresenter
                        Content="{TemplateBinding Content}"
                        ContentTemplate="{TemplateBinding ContentTemplate}"
                        Margin="4,0,0,0"
                        Name="PART_ContentPresenter"
                        RecognizesAccessKey="True"
                        VerticalAlignment="Center" />
                </Panel>
            </ControlTemplate>
        </Setter>
    </ControlTheme>
</ResourceDictionary>