<ResourceDictionary
    xmlns="https://github.com/avaloniaui"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    x:CompileBindings="True">
    <Design.PreviewWith>
        <ListBox Margin="30">
            <ListBoxItem>Item 1</ListBoxItem>
            <ListBoxItem>Item 2</ListBoxItem>
            <ListBoxItem>Item 3</ListBoxItem>
            <ListBoxItem IsEnabled="False" IsSelected="True">Item 3</ListBoxItem>
            <ListBoxItem>Item 4</ListBoxItem>
        </ListBox>
    </Design.PreviewWith>

    <ControlTheme x:Key="{x:Type ListBox}" TargetType="ListBox">
        <Setter Property="ScrollViewer.HorizontalScrollBarVisibility" Value="Disabled" />
        <Setter Property="ScrollViewer.VerticalScrollBarVisibility" Value="Auto" />
        <Setter Property="ScrollViewer.IsScrollChainingEnabled" Value="True" />
        <Setter Property="Template">
            <ControlTemplate TargetType="ListBox">
                <Border
                    Name="border"
                    Background="{TemplateBinding Background}"
                    BorderBrush="{TemplateBinding BorderBrush}"
                    BorderThickness="{TemplateBinding BorderThickness}"
                    ClipToBounds="{TemplateBinding ClipToBounds}"
                    CornerRadius="{TemplateBinding CornerRadius}">
                    <ScrollViewer
                        Name="PART_ScrollViewer"
                        AllowAutoHide="{TemplateBinding (ScrollViewer.AllowAutoHide)}"
                        HorizontalScrollBarVisibility="{TemplateBinding (ScrollViewer.HorizontalScrollBarVisibility)}"
                        IsScrollChainingEnabled="{TemplateBinding (ScrollViewer.IsScrollChainingEnabled)}"
                        IsDeferredScrollingEnabled="{TemplateBinding (ScrollViewer.IsDeferredScrollingEnabled)}"
                        IsScrollInertiaEnabled="{TemplateBinding (ScrollViewer.IsScrollInertiaEnabled)}"
                        VerticalScrollBarVisibility="{TemplateBinding (ScrollViewer.VerticalScrollBarVisibility)}">
                        <ItemsPresenter
                            Name="PART_ItemsPresenter"
                            Margin="{TemplateBinding Padding}"
                            ItemsPanel="{TemplateBinding ItemsPanel}" />
                    </ScrollViewer>
                </Border>
            </ControlTemplate>
        </Setter>
    </ControlTheme>
    <ControlTheme x:Key="{x:Type ListBoxItem}" TargetType="ListBoxItem">
        <Setter Property="Background" Value="{DynamicResource ListBoxItemDefaultBackground}" />
        <Setter Property="Padding" Value="{DynamicResource ListBoxItemDefaultPadding}" />
        <Setter Property="CornerRadius" Value="{DynamicResource ListBoxItemCornerRadius}" />
        <Setter Property="Template">
            <ControlTemplate TargetType="ListBoxItem">
                <ContentPresenter
                    Name="PART_ContentPresenter"
                    Padding="{TemplateBinding Padding}"
                    HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}"
                    VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}"
                    Background="{TemplateBinding Background}"
                    BorderBrush="{TemplateBinding BorderBrush}"
                    BorderThickness="{TemplateBinding BorderThickness}"
                    Content="{TemplateBinding Content}"
                    ContentTemplate="{TemplateBinding ContentTemplate}"
                    CornerRadius="{TemplateBinding CornerRadius}"
                    Foreground="{TemplateBinding Foreground}" />
            </ControlTemplate>
        </Setter>

        <Style Selector="^:disabled">
            <Setter Property="Foreground" Value="{DynamicResource ListBoxItemDisabledForeground}" />
            <Setter Property="Background" Value="{DynamicResource ListBoxItemDisabledBackground}" />
            <Style Selector="^:selected">
                <Setter Property="Background" Value="{DynamicResource ListBoxItemSelectedDisabledBackground}" />
            </Style>
        </Style>

        <!--  Pointerover State  -->
        <Style Selector="^:pointerover">
            <Setter Property="Foreground" Value="{DynamicResource ListBoxItemPointeroverForeground}" />
            <Setter Property="Background" Value="{DynamicResource ListBoxItemPointeroverBackground}" />
        </Style>

        <!--  Pressed State  -->
        <Style Selector="^:pressed">
            <Setter Property="Foreground" Value="{DynamicResource ListBoxItemPressedForeground}" />
            <Setter Property="Background" Value="{DynamicResource ListBoxItemPressedBackground}" />
        </Style>

        <!--  Selected State  -->
        <Style Selector="^:selected">
            <Setter Property="Foreground" Value="{DynamicResource ListBoxItemSelectedForeground}" />
            <Setter Property="Background" Value="{DynamicResource ListBoxItemSelectedBackground}" />
            <Style Selector="^:pointerover">
                <Setter Property="Background" Value="{DynamicResource ListBoxItemSelectedPointeroverBackground}" />
            </Style>
        </Style>
    </ControlTheme>

    <!-- RadioGroup -->
    <ControlTheme x:Key="RadioGroupListBox" TargetType="ListBox">
        <Setter Property="ItemContainerTheme" Value="{DynamicResource RadioGroupListBoxItem}" />
        <Setter Property="ItemsPanel">
            <ItemsPanelTemplate>
                <StackPanel Orientation="Horizontal" />
            </ItemsPanelTemplate>
        </Setter>
        <Setter Property="Template">
            <ControlTemplate TargetType="ListBox">
                <Border
                    Background="{TemplateBinding Background}"
                    BorderBrush="{TemplateBinding BorderBrush}"
                    BorderThickness="{TemplateBinding BorderThickness}"
                    ClipToBounds="{TemplateBinding ClipToBounds}"
                    CornerRadius="{TemplateBinding CornerRadius}">
                    <ItemsPresenter
                        Theme="{DynamicResource RadioGroupListBoxItem}"
                        ItemsPanel="{TemplateBinding ItemsPanel}" />
                </Border>
            </ControlTemplate>
        </Setter>
    </ControlTheme>
    <ControlTheme x:Key="RadioGroupListBoxItem" TargetType="ListBoxItem">
        <Setter Property="HorizontalAlignment" Value="Left" />
        <Setter Property="VerticalAlignment" Value="Top" />
        <Setter Property="HorizontalContentAlignment" Value="Left" />
        <Setter Property="VerticalContentAlignment" Value="Center" />
        <Setter Property="FontSize" Value="{DynamicResource RadioButtonFontSize}" />
        <Setter Property="Foreground" Value="{DynamicResource RadioButtonForeground}" />
        <Setter Property="Background" Value="{DynamicResource RadioButtonDefaultBackground}" />
        <Setter Property="BorderBrush" Value="{DynamicResource RadioButtonDefaultBorderBrush}" />
        <Setter Property="CornerRadius" Value="{DynamicResource RadioButtonBoxCornerRadius}" />
        <Setter Property="Cursor" Value="Hand" />
        <Setter Property="Template">
            <ControlTemplate TargetType="ListBoxItem">
                <Border
                    Name="RootBorder"
                    Background="{TemplateBinding Background}"
                    BorderBrush="{TemplateBinding BorderBrush}"
                    BorderThickness="{TemplateBinding BorderThickness}"
                    CornerRadius="{TemplateBinding CornerRadius}">
                    <Grid ColumnDefinitions="Auto,*">
                        <Panel
                            Grid.Column="0"
                            TemplatedControl.IsTemplateFocusTarget="True"
                            VerticalAlignment="{TemplateBinding VerticalContentAlignment}">
                            <Ellipse
                                Name="OuterEllipse"
                                Width="{DynamicResource RadioButtonIconRadius}"
                                Height="{DynamicResource RadioButtonIconRadius}"
                                Fill="{DynamicResource RadioButtonUncheckIconDefaultBackground}"
                                Stroke="{DynamicResource RadioButtonUncheckIconDefaultBorderBrush}"
                                StrokeThickness="{DynamicResource RadioButtonUncheckIconDefaultThickness}"
                                UseLayoutRounding="False" />

                            <Ellipse
                                Name="CheckGlyph"
                                Width="{DynamicResource RadioButtonGlyphRadius}"
                                Height="{DynamicResource RadioButtonGlyphRadius}"
                                Fill="{DynamicResource RadioButtonCheckGlyphFill}"
                                Stroke="{DynamicResource RadioButtonCheckGlyphFill}"
                                UseLayoutRounding="False" />
                        </Panel>
                        <ContentPresenter
                            Name="PART_ContentPresenter"
                            Grid.Column="1"
                            Margin="{DynamicResource RadioButtonContentMargin}"
                            HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
                            VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
                            Content="{TemplateBinding Content}"
                            ContentTemplate="{TemplateBinding ContentTemplate}"
                            Foreground="{TemplateBinding Foreground}"
                            IsVisible="{TemplateBinding Content,Converter={x:Static ObjectConverters.IsNotNull}}"
                            FontSize="{TemplateBinding FontSize}"
                            RecognizesAccessKey="True"
                            TextWrapping="Wrap" />
                    </Grid>
                </Border>
            </ControlTemplate>
        </Setter>

        <!--  Unchecked State  -->
        <Style Selector="^ /template/ Ellipse#OuterEllipse">
            <Setter Property="Stroke" Value="{DynamicResource RadioButtonUncheckIconDefaultBorderBrush}" />
            <Setter Property="Fill" Value="{DynamicResource RadioButtonUncheckIconDefaultBackground}" />
        </Style>
        <Style Selector="^ /template/ Ellipse#CheckGlyph">
            <Setter Property="Opacity" Value="0" />
        </Style>

        <!--  Unchecked Pointerover State  -->
        <Style Selector="^:pointerover">
            <Style Selector="^ /template/ Ellipse#OuterEllipse">
                <Setter Property="Stroke" Value="{DynamicResource RadioButtonUncheckIconPointeroverBorderBrush}" />
                <Setter Property="Fill" Value="{DynamicResource RadioButtonUncheckIconPointeroverBackground}" />
            </Style>
        </Style>

        <!--  Unchecked Pressed State  -->
        <Style Selector="^:pressed">
            <Style Selector="^ /template/ Ellipse#OuterEllipse">
                <Setter Property="Stroke" Value="{DynamicResource RadioButtonUncheckIconPressedBorderBrush}" />
                <Setter Property="Fill" Value="{DynamicResource RadioButtonUncheckIconPressedBackground}" />
            </Style>
        </Style>

        <!--  Unchecked Disabled state  -->
        <Style Selector="^:disabled">
            <Style Selector="^ /template/ Ellipse#OuterEllipse">
                <Setter Property="Stroke" Value="{DynamicResource RadioButtonUncheckIconDisabledBorderBrush}" />
                <Setter Property="Fill" Value="{DynamicResource RadioButtonUncheckIconDisabledBackground}" />
            </Style>
            <Style Selector="^ /template/ ContentPresenter#PART_ContentPresenter">
                <Setter Property="Foreground" Value="{DynamicResource RadioButtonDisabledForeground}" />
            </Style>
        </Style>

        <!--  Checked State  -->
        <Style Selector="^:selected">
            <Style Selector="^ /template/ Ellipse#OuterEllipse">
                <Setter Property="Stroke" Value="{DynamicResource RadioButtonCheckIconDefaultBorderBrush}" />
                <Setter Property="Fill" Value="{DynamicResource RadioButtonCheckIconDefaultBackground}" />
            </Style>
            <Style Selector="^ /template/ Ellipse#CheckGlyph">
                <Setter Property="Opacity" Value="1" />
            </Style>

            <!--  Checked Pointerover State  -->
            <Style Selector="^:pointerover">
                <Style Selector="^ /template/ Ellipse#OuterEllipse">
                    <Setter Property="Stroke" Value="{DynamicResource RadioButtonCheckIconPointeroverBorderBrush}" />
                    <Setter Property="Fill" Value="{DynamicResource RadioButtonCheckIconPointeroverBackground}" />
                </Style>
            </Style>

            <!--  Checked Pressed State  -->
            <Style Selector="^:pressed">
                <Style Selector="^ /template/ Ellipse#OuterEllipse">
                    <Setter Property="Stroke" Value="{DynamicResource RadioButtonCheckIconPressedBorderBrush}" />
                    <Setter Property="Fill" Value="{DynamicResource RadioButtonCheckIconPressedBackground}" />
                </Style>
            </Style>

            <!--  Checked Disabled State  -->
            <Style Selector="^:disabled">
                <Style Selector="^ /template/ Ellipse#OuterEllipse">
                    <Setter Property="Stroke" Value="{DynamicResource RadioButtonCheckIconDisabledBorderBrush}" />
                    <Setter Property="Fill" Value="{DynamicResource RadioButtonCheckIconDisabledBackground}" />
                </Style>
                <Style Selector="^ /template/ ContentPresenter#PART_ContentPresenter">
                    <Setter Property="Foreground" Value="{DynamicResource RadioButtonDisabledForeground}" />
                </Style>
            </Style>
        </Style>
    </ControlTheme>


    <ControlTheme x:Key="ButtonRadioGroupListBox"
                  BasedOn="{StaticResource RadioGroupListBox}"
                  TargetType="ListBox">
        <Setter Property="ItemContainerTheme" Value="{DynamicResource ButtonRadioGroupListBoxItem}" />
    </ControlTheme>
    <ControlTheme x:Key="ButtonRadioGroupListBoxItem" TargetType="ListBoxItem">
        <Setter Property="VerticalContentAlignment" Value="Center" />
        <Setter Property="Padding" Value="{DynamicResource RadioButtonButtonDefaultPadding}" />
        <Setter Property="Margin" Value="2" />
        <Setter Property="FontWeight" Value="{DynamicResource RadioButtonButtonFontWeight}" />
        <Setter Property="FontSize" Value="{DynamicResource RadioButtonButtonDefaultFontSize}" />
        <Setter Property="Foreground" Value="{DynamicResource RadioButtonButtonUncheckedForeground}" />
        <Setter Property="CornerRadius" Value="{DynamicResource RadioButtonButtonCornerRadius}" />
        <Setter Property="Cursor" Value="Hand" />
        <Setter Property="Template">
            <ControlTemplate TargetType="ListBoxItem">
                <ContentPresenter
                    Name="PART_ContentPresenter"
                    Margin="{TemplateBinding Margin}"
                    Padding="{TemplateBinding Padding}"
                    HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}"
                    VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}"
                    Background="{TemplateBinding Background}"
                    BorderBrush="{TemplateBinding BorderBrush}"
                    BorderThickness="{TemplateBinding BorderThickness}"
                    Content="{TemplateBinding Content}"
                    ContentTemplate="{TemplateBinding ContentTemplate}"
                    CornerRadius="{TemplateBinding CornerRadius}"
                    RecognizesAccessKey="True"
                    TextElement.FontSize="{TemplateBinding FontSize}"
                    TextElement.FontWeight="{TemplateBinding FontWeight}"
                    UseLayoutRounding="False" />
            </ControlTemplate>
        </Setter>
        <Setter Property="Background" Value="Transparent" />
        <Style Selector="^:pointerover">
            <Setter Property="Background" Value="{DynamicResource RadioButtonButtonUncheckedPointeroverBackground}" />
        </Style>
        <Style Selector="^:disabled">
            <Setter Property="Foreground" Value="{DynamicResource RadioButtonButtonUncheckedDisabledForeground}" />
        </Style>
        <Style Selector="^:selected">
            <Setter Property="Background" Value="{DynamicResource RadioButtonButtonCheckedBackground}" />
            <Setter Property="Foreground" Value="{DynamicResource RadioButtonButtonCheckedForeground}" />
            <Style Selector="^:disabled">
                <Setter Property="Foreground" Value="{DynamicResource RadioButtonButtonCheckedDisabledForeground}" />
            </Style>
        </Style>
        <Style Selector="^.Small">
            <Setter Property="FontSize" Value="{DynamicResource RadioButtonButtonSmallFontSize}" />
            <Setter Property="Padding" Value="{DynamicResource RadioButtonButtonSmallPadding}" />
        </Style>
        <Style Selector="^.Large">
            <Setter Property="FontSize" Value="{DynamicResource RadioButtonButtonLargeFontSize}" />
            <Setter Property="Padding" Value="{DynamicResource RadioButtonButtonLargePadding}" />
        </Style>
    </ControlTheme>


    <ControlTheme x:Key="CardRadioGroupListBox"
                  BasedOn="{StaticResource RadioGroupListBox}"
                  TargetType="ListBox">
        <Setter Property="ItemContainerTheme" Value="{DynamicResource CardRadioGroupListBoxItem}" />
    </ControlTheme>
    <ControlTheme x:Key="CardRadioGroupListBoxItem" TargetType="ListBoxItem">
        <Setter Property="HorizontalContentAlignment" Value="Left" />
        <Setter Property="VerticalContentAlignment" Value="Center" />
        <Setter Property="Padding" Value="{DynamicResource RadioButtonCardPadding}" />
        <Setter Property="FontSize" Value="{DynamicResource RadioButtonFontSize}" />
        <Setter Property="CornerRadius" Value="{DynamicResource RadioButtonCardCornerRadius}" />
        <Setter Property="Background" Value="{DynamicResource RadioButtonCardDefaultBackground}" />
        <Setter Property="BorderThickness" Value="{DynamicResource RadioButtonBorderThickness}" />
        <Setter Property="Cursor" Value="Hand" />
        <Setter Property="Template">
            <ControlTemplate TargetType="ListBoxItem">
                <Border
                    Name="RootBorder"
                    Padding="{TemplateBinding Padding}"
                    Background="{TemplateBinding Background}"
                    BorderBrush="{TemplateBinding BorderBrush}"
                    BorderThickness="{TemplateBinding BorderThickness}"
                    CornerRadius="{TemplateBinding CornerRadius}">
                    <Grid
                        HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
                        VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
                        ColumnDefinitions="Auto,*">
                        <Panel
                            Grid.Column="0"
                            VerticalAlignment="Top"
                            Margin="{DynamicResource RadioButtonIconMargin}">
                            <Ellipse
                                Name="OuterEllipse"
                                Width="{DynamicResource RadioButtonIconRadius}"
                                Height="{DynamicResource RadioButtonIconRadius}"
                                Fill="{DynamicResource RadioButtonUncheckIconDefaultBackground}"
                                Stroke="{DynamicResource RadioButtonUncheckIconDefaultBorderBrush}"
                                StrokeThickness="1"
                                UseLayoutRounding="False" />

                            <Ellipse
                                Name="CheckGlyph"
                                Width="{DynamicResource RadioButtonGlyphRadius}"
                                Height="{DynamicResource RadioButtonGlyphRadius}"
                                Fill="{DynamicResource RadioButtonCheckGlyphFill}"
                                Stroke="{DynamicResource RadioButtonCheckGlyphFill}"
                                UseLayoutRounding="False" />
                        </Panel>

                        <ContentPresenter
                            Name="PART_ContentPresenter"
                            Grid.Column="1"
                            Margin="{DynamicResource RadioButtonContentMargin}"
                            HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
                            VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
                            Content="{TemplateBinding Content}"
                            ContentTemplate="{TemplateBinding ContentTemplate}"
                            Foreground="{TemplateBinding Foreground}"
                            IsVisible="{TemplateBinding Content,Converter={x:Static ObjectConverters.IsNotNull}}"
                            RecognizesAccessKey="True"
                            FontSize="{TemplateBinding FontSize}"
                            TextWrapping="Wrap" />
                    </Grid>
                </Border>
            </ControlTemplate>
        </Setter>

        <!--  Unchecked State  -->
        <Style Selector="^ /template/ Ellipse#OuterEllipse">
            <Setter Property="Stroke" Value="{DynamicResource RadioButtonUncheckIconDefaultBorderBrush}" />
            <Setter Property="Fill" Value="{DynamicResource RadioButtonUncheckIconDefaultBackground}" />
        </Style>
        <Style Selector="^ /template/ Ellipse#CheckGlyph">
            <Setter Property="Opacity" Value="0" />
        </Style>

        <!--  Unchecked Pointerover State  -->
        <Style Selector="^:pointerover">
            <Setter Property="Background" Value="{DynamicResource RadioButtonCardUncheckPointeroverBackground}" />
            <Style Selector="^ /template/ Ellipse#OuterEllipse">
                <Setter Property="Stroke" Value="{DynamicResource RadioButtonUncheckIconPointeroverBorderBrush}" />
            </Style>
        </Style>

        <!--  Unchecked Pressed State  -->
        <Style Selector="^:pressed">
            <Setter Property="Background" Value="{DynamicResource RadioButtonCardUncheckPressedBackground}" />
            <Style Selector="^ /template/ Ellipse#OuterEllipse">
                <Setter Property="Stroke" Value="{DynamicResource RadioButtonUncheckIconPressedBorderBrush}" />
            </Style>
        </Style>

        <!--  Unchecked Disabled state  -->
        <Style Selector="^:disabled">
            <Style Selector="^ /template/ Ellipse#OuterEllipse">
                <Setter Property="Stroke" Value="{DynamicResource RadioButtonUncheckIconDisabledBorderBrush}" />
                <Setter Property="Fill" Value="{DynamicResource RadioButtonUncheckIconDisabledBackground}" />
            </Style>
            <Style Selector="^ /template/ ContentPresenter#PART_ContentPresenter">
                <Setter Property="Foreground" Value="{DynamicResource RadioButtonDisabledForeground}" />
            </Style>
        </Style>

        <!--  Checked State  -->
        <Style Selector="^:selected">
            <Setter Property="Background" Value="{DynamicResource RadioButtonCardCheckedBackground}" />
            <Setter Property="BorderBrush" Value="{DynamicResource RadioButtonCardCheckDefaultBorderBrush}" />
            <Style Selector="^ /template/ Ellipse#OuterEllipse">
                <Setter Property="Stroke" Value="{DynamicResource RadioButtonCheckIconDefaultBorderBrush}" />
                <Setter Property="Fill" Value="{DynamicResource RadioButtonCheckIconDefaultBackground}" />
            </Style>
            <Style Selector="^ /template/ Ellipse#CheckGlyph">
                <Setter Property="Opacity" Value="1" />
            </Style>

            <!--  Checked Pointerover State  -->
            <Style Selector="^:pointerover">
                <Setter Property="BorderBrush" Value="{DynamicResource RadioButtonCardCheckPointeroverBorderBrush}" />
                <Style Selector="^ /template/ Ellipse#OuterEllipse">
                    <Setter Property="Stroke" Value="{DynamicResource RadioButtonCheckIconPointeroverBorderBrush}" />
                    <Setter Property="Fill" Value="{DynamicResource RadioButtonCheckIconPointeroverBackground}" />
                </Style>
                <Style Selector="^ /template/ Ellipse#OuterEllipse">
                    <Setter Property="Stroke" Value="{DynamicResource RadioButtonCheckIconPointeroverBorderBrush}" />
                    <Setter Property="Fill" Value="{DynamicResource RadioButtonCheckIconPointeroverBackground}" />
                </Style>
            </Style>

            <!--  Checked Pressed State  -->
            <Style Selector="^:pressed">
                <Setter Property="BorderBrush" Value="{DynamicResource RadioButtonCardCheckPressedBorderBrush}" />
                <Style Selector="^ /template/ Ellipse#OuterEllipse">
                    <Setter Property="Stroke" Value="{DynamicResource RadioButtonCheckIconPressedBorderBrush}" />
                    <Setter Property="Fill" Value="{DynamicResource RadioButtonCheckIconPressedBackground}" />
                </Style>
            </Style>

            <!--  Checked Disabled State  -->
            <Style Selector="^:disabled">
                <Style Selector="^ /template/ Ellipse#OuterEllipse">
                    <Setter Property="Stroke" Value="{DynamicResource RadioButtonCheckIconDisabledBorderBrush}" />
                    <Setter Property="Fill" Value="{DynamicResource RadioButtonCheckIconDisabledBackground}" />
                </Style>
                <Style Selector="^ /template/ Border#RootBorder">
                    <Setter Property="BorderBrush" Value="{DynamicResource RadioButtonCheckIconDisabledBackground}" />
                    <Setter Property="Background" Value="{DynamicResource RadioButtonCardCheckedBackground}" />
                </Style>
                <Style Selector="^ /template/ ContentPresenter#PART_ContentPresenter">
                    <Setter Property="Foreground" Value="{DynamicResource RadioButtonDisabledForeground}" />
                </Style>
            </Style>
        </Style>
    </ControlTheme>


    <ControlTheme x:Key="PureCardRadioGroupListBox"
                  BasedOn="{StaticResource RadioGroupListBox}"
                  TargetType="ListBox">
        <Setter Property="ItemContainerTheme" Value="{DynamicResource PureCardRadioGroupListBoxItem}" />
    </ControlTheme>
    <ControlTheme x:Key="PureCardRadioGroupListBoxItem" TargetType="ListBoxItem">
        <Setter Property="HorizontalContentAlignment" Value="Left" />
        <Setter Property="VerticalContentAlignment" Value="Center" />
        <Setter Property="Padding" Value="{DynamicResource RadioButtonCardPadding}" />
        <Setter Property="FontSize" Value="{DynamicResource RadioButtonFontSize}" />
        <Setter Property="CornerRadius" Value="{DynamicResource RadioButtonCardCornerRadius}" />
        <Setter Property="Background" Value="{DynamicResource RadioButtonCardDefaultBackground}" />
        <Setter Property="BorderThickness" Value="{DynamicResource RadioButtonBorderThickness}" />
        <Setter Property="Cursor" Value="Hand" />
        <Setter Property="Template">
            <ControlTemplate TargetType="ListBoxItem">
                <ContentPresenter
                    Name="PART_ContentPresenter"
                    Padding="{TemplateBinding Padding}"
                    HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}"
                    VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}"
                    Foreground="{TemplateBinding Foreground}"
                    Background="{TemplateBinding Background}"
                    BorderBrush="{TemplateBinding BorderBrush}"
                    BorderThickness="{TemplateBinding BorderThickness}"
                    Content="{TemplateBinding Content}"
                    ContentTemplate="{TemplateBinding ContentTemplate}"
                    CornerRadius="{TemplateBinding CornerRadius}"
                    RecognizesAccessKey="True"
                    UseLayoutRounding="False"
                    TextWrapping="Wrap" />
            </ControlTemplate>
        </Setter>
        <Setter Property="BorderBrush" Value="{DynamicResource RadioButtonCardDefaultBorderBrush}" />
        <Style Selector="^:pointerover">
            <Setter Property="Background" Value="{DynamicResource RadioButtonCardUncheckPointeroverBackground}" />
        </Style>
        <Style Selector="^:pressed">
            <Setter Property="Background" Value="{DynamicResource RadioButtonCardUncheckPressedBackground}" />
        </Style>
        <Style Selector="^:disabled">
            <Style Selector="^ /template/ ContentPresenter#PART_ContentPresenter">
                <Setter Property="Foreground" Value="{DynamicResource RadioButtonDisabledForeground}" />
            </Style>
        </Style>
        <Style Selector="^:selected">
            <Setter Property="Background" Value="{DynamicResource RadioButtonCardCheckedBackground}" />
            <Setter Property="BorderBrush" Value="{DynamicResource RadioButtonCardCheckDefaultBorderBrush}" />
            <Style Selector="^:pointerover">
                <Setter Property="BorderBrush" Value="{DynamicResource RadioButtonCardCheckPointeroverBorderBrush}" />
            </Style>
            <Style Selector="^:pressed">
                <Setter Property="BorderBrush" Value="{DynamicResource RadioButtonCardCheckPressedBorderBrush}" />
            </Style>
            <Style Selector="^:disabled">
                <Setter Property="BorderBrush" Value="{DynamicResource RadioButtonCheckIconDisabledBackground}" />
                <Setter Property="Background" Value="{DynamicResource RadioButtonCardCheckedBackground}" />
                <Style Selector="^ /template/ ContentPresenter#PART_ContentPresenter">
                    <Setter Property="Foreground" Value="{DynamicResource RadioButtonDisabledForeground}" />
                </Style>
            </Style>
        </Style>
    </ControlTheme>


    <!-- CheckGroup -->
    <ControlTheme x:Key="CheckGroupListBox"
                  BasedOn="{StaticResource RadioGroupListBox}"
                  TargetType="ListBox">
        <Setter Property="ItemContainerTheme" Value="{DynamicResource CheckGroupListBoxItem}" />
    </ControlTheme>
    <ControlTheme x:Key="CheckGroupListBoxItem" TargetType="ListBoxItem">
        <Setter Property="HorizontalAlignment" Value="Left" />
        <Setter Property="VerticalAlignment" Value="Top" />
        <Setter Property="HorizontalContentAlignment" Value="Left" />
        <Setter Property="VerticalContentAlignment" Value="Center" />
        <Setter Property="FontSize" Value="{DynamicResource CheckBoxFontSize}" />
        <Setter Property="Foreground" Value="{DynamicResource CheckBoxForeground}" />
        <Setter Property="Background" Value="{DynamicResource CheckBoxDefaultBackground}" />
        <Setter Property="BorderBrush" Value="{DynamicResource CheckBoxDefaultBorderBrush}" />
        <Setter Property="CornerRadius" Value="{DynamicResource CheckBoxBoxCornerRadius}" />
        <Setter Property="Cursor" Value="Hand" />
        <Setter Property="Template">
            <ControlTemplate TargetType="ListBoxItem">
                <Border
                    Name="RootBorder"
                    Background="{TemplateBinding Background}"
                    BorderBrush="{TemplateBinding BorderBrush}"
                    BorderThickness="{TemplateBinding BorderThickness}"
                    CornerRadius="{TemplateBinding CornerRadius}">
                    <Grid ColumnDefinitions="Auto,*">
                        <Panel
                            Grid.Column="0"
                            TemplatedControl.IsTemplateFocusTarget="True"
                            VerticalAlignment="{TemplateBinding VerticalContentAlignment}">
                            <Border
                                Name="NormalRectangle"
                                Width="{DynamicResource CheckBoxBoxWidth}"
                                Height="{DynamicResource CheckBoxBoxHeight}"
                                Background="{DynamicResource CheckBoxDefaultBackground}"
                                BorderBrush="{DynamicResource CheckBoxDefaultBorderBrush}"
                                BorderThickness="{DynamicResource CheckBoxBoxBorderThickness}"
                                CornerRadius="{TemplateBinding CornerRadius}"
                                UseLayoutRounding="False" />
                            <PathIcon
                                Name="CheckGlyph"
                                Theme="{DynamicResource InnerPathIcon}"
                                Width="{DynamicResource CheckBoxBoxGlyphWidth}"
                                Height="{DynamicResource CheckBoxBoxGlyphHeight}"
                                Foreground="{DynamicResource CheckBoxGlyphFill}" />
                        </Panel>
                        <ContentPresenter
                            Name="PART_ContentPresenter"
                            Grid.Column="1"
                            Margin="{DynamicResource CheckBoxContentMargin}"
                            HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
                            VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
                            Content="{TemplateBinding Content}"
                            ContentTemplate="{TemplateBinding ContentTemplate}"
                            IsVisible="{TemplateBinding Content,Converter={x:Static ObjectConverters.IsNotNull}}"
                            FontSize="{TemplateBinding FontSize}"
                            RecognizesAccessKey="True"
                            TextWrapping="Wrap" />
                    </Grid>
                </Border>
            </ControlTemplate>
        </Setter>

        <!--  Unchecked Pointerover State  -->
        <Style Selector="^:pointerover">
            <Style Selector="^ /template/ Border#NormalRectangle">
                <Setter Property="BorderBrush" Value="{DynamicResource CheckBoxPointeroverBorderBrush}" />
                <Setter Property="Background" Value="{DynamicResource CheckBoxPointeroverBackground}" />
            </Style>
        </Style>

        <!--  Unchecked Pressed State  -->
        <Style Selector="^:pressed">
            <Style Selector="^ /template/ Border#NormalRectangle">
                <Setter Property="BorderBrush" Value="{DynamicResource CheckBoxPressedBorderBrush}" />
                <Setter Property="Background" Value="{DynamicResource CheckBoxPressedBackground}" />
            </Style>
        </Style>

        <!--  Unchecked Disabled state  -->
        <Style Selector="^:disabled">
            <Style Selector="^ /template/ ContentPresenter#PART_ContentPresenter">
                <Setter Property="Foreground" Value="{DynamicResource CheckBoxDisabledForeground}" />
            </Style>
            <Style Selector="^ /template/ Border#NormalRectangle">
                <Setter Property="BorderBrush" Value="{DynamicResource CheckBoxDefaultDisabledBorderBrush}" />
                <Setter Property="Background" Value="{DynamicResource CheckBoxDefaultDisabledBackground}" />
            </Style>
        </Style>

        <Style Selector="^:selected">
            <Style Selector="^ /template/ Border#NormalRectangle">
                <Setter Property="BorderBrush" Value="{DynamicResource CheckBoxCheckedDefaultBorderBrush}" />
                <Setter Property="Background" Value="{DynamicResource CheckBoxCheckedDefaultBackground}" />
            </Style>

            <Style Selector="^ /template/ PathIcon#CheckGlyph">
                <Setter Property="Data" Value="{DynamicResource CheckBoxCheckGlyph}" />
                <Setter Property="Opacity" Value="1" />
            </Style>

            <!--  Checked Pointerover State  -->
            <Style Selector="^:pointerover">
                <Style Selector="^ /template/ Border#NormalRectangle">
                    <Setter Property="BorderBrush" Value="{DynamicResource CheckBoxCheckedPointeroverBorderBrush}" />
                    <Setter Property="Background" Value="{DynamicResource CheckBoxCheckedPointeroverBackground}" />
                </Style>
            </Style>

            <!--  Checked Pressed State  -->
            <Style Selector="^:pressed">
                <Style Selector="^ /template/ Border#NormalRectangle">
                    <Setter Property="BorderBrush" Value="{DynamicResource CheckBoxCheckedPressedBorderBrush}" />
                    <Setter Property="Background" Value="{DynamicResource CheckBoxCheckedPressedBackground}" />
                </Style>
            </Style>

            <!--  Checked Disabled State  -->
            <Style Selector="^:disabled">
                <Style Selector="^ /template/ ContentPresenter#PART_ContentPresenter">
                    <Setter Property="Foreground" Value="{DynamicResource CheckBoxDisabledForeground}" />
                </Style>
                <Style Selector="^ /template/ Border#NormalRectangle">
                    <Setter Property="BorderBrush" Value="{DynamicResource CheckBoxCheckedDisabledBorderBrush}" />
                    <Setter Property="Background" Value="{DynamicResource CheckBoxCheckedDisabledBackground}" />
                </Style>

                <Style Selector="^ /template/ Path#CheckGlyph">
                    <Setter Property="Fill" Value="{DynamicResource CheckBoxGlyphDisabledFill}" />
                </Style>
            </Style>
        </Style>

        <Style Selector="^:indeterminate">
            <Style Selector="^ /template/ Border#NormalRectangle">
                <Setter Property="BorderBrush" Value="{DynamicResource CheckBoxCheckedDefaultBorderBrush}" />
                <Setter Property="Background" Value="{DynamicResource CheckBoxCheckedDefaultBackground}" />
            </Style>

            <Style Selector="^ /template/ PathIcon#CheckGlyph">
                <Setter Property="Data" Value="{DynamicResource CheckBoxIndeterminateGlyph}" />
                <Setter Property="Opacity" Value="1" />
            </Style>

            <!--  Checked Pointerover State  -->
            <Style Selector="^:pointerover">
                <Style Selector="^ /template/ Border#NormalRectangle">
                    <Setter Property="BorderBrush" Value="{DynamicResource CheckBoxCheckedPointeroverBorderBrush}" />
                    <Setter Property="Background" Value="{DynamicResource CheckBoxCheckedPointeroverBackground}" />
                </Style>
            </Style>

            <!--  Checked Pressed State  -->
            <Style Selector="^:pressed">
                <Style Selector="^ /template/ Border#NormalRectangle">
                    <Setter Property="BorderBrush" Value="{DynamicResource CheckBoxCheckedPressedBorderBrush}" />
                    <Setter Property="Background" Value="{DynamicResource CheckBoxCheckedPressedBackground}" />
                </Style>
            </Style>

            <!--  Checked Disabled State  -->
            <Style Selector="^:disabled">
                <Style Selector="^ /template/ ContentPresenter#PART_ContentPresenter">
                    <Setter Property="Foreground" Value="{DynamicResource CheckBoxDisabledForeground}" />
                </Style>
                <Style Selector="^ /template/ Border#NormalRectangle">
                    <Setter Property="BorderBrush" Value="{DynamicResource CheckBoxCheckedDisabledBorderBrush}" />
                    <Setter Property="Background" Value="{DynamicResource CheckBoxCheckedDisabledBackground}" />
                </Style>

                <Style Selector="^ /template/ Path#CheckGlyph">
                    <Setter Property="Fill" Value="{DynamicResource CheckBoxGlyphDisabledFill}" />
                </Style>
            </Style>
        </Style>
    </ControlTheme>


    <ControlTheme x:Key="CardCheckGroupListBox"
                  BasedOn="{StaticResource RadioGroupListBox}"
                  TargetType="ListBox">
        <Setter Property="ItemContainerTheme" Value="{DynamicResource CardCheckGroupListBoxItem}" />
    </ControlTheme>
    <ControlTheme x:Key="CardCheckGroupListBoxItem" TargetType="ListBoxItem">
        <Setter Property="HorizontalContentAlignment" Value="Left" />
        <Setter Property="VerticalContentAlignment" Value="Center" />
        <Setter Property="Padding" Value="{DynamicResource CheckBoxCardPadding}" />
        <Setter Property="FontSize" Value="{DynamicResource CheckBoxFontSize}" />
        <Setter Property="CornerRadius" Value="{DynamicResource CheckBoxCardCornerRadius}" />
        <Setter Property="Background" Value="Transparent" />
        <Setter Property="BorderThickness" Value="{DynamicResource CheckBoxCardBorderThickness}" />
        <Setter Property="Cursor" Value="Hand" />
        <Setter Property="Template">
            <ControlTemplate TargetType="ListBoxItem">
                <Border
                    Name="RootBorder"
                    Padding="{TemplateBinding Padding}"
                    Background="{TemplateBinding Background}"
                    BorderBrush="{TemplateBinding BorderBrush}"
                    BorderThickness="{TemplateBinding BorderThickness}"
                    CornerRadius="{TemplateBinding CornerRadius}">
                    <Grid
                        HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
                        VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
                        ColumnDefinitions="Auto,*">
                        <Panel
                            Grid.Column="0"
                            VerticalAlignment="Top"
                            Margin="{DynamicResource CheckBoxBoxMargin}">
                            <Border
                                Name="NormalRectangle"
                                Width="{DynamicResource CheckBoxBoxWidth}"
                                Height="{DynamicResource CheckBoxBoxHeight}"
                                Background="{DynamicResource CheckBoxDefaultBackground}"
                                BorderBrush="{DynamicResource CheckBoxDefaultBorderBrush}"
                                BorderThickness="{DynamicResource CheckBoxBoxBorderThickness}"
                                CornerRadius="{DynamicResource CheckBoxBoxCornerRadius}"
                                UseLayoutRounding="False" />
                            <PathIcon
                                Name="CheckGlyph"
                                Theme="{DynamicResource InnerPathIcon}"
                                Width="{DynamicResource CheckBoxBoxGlyphWidth}"
                                Height="{DynamicResource CheckBoxBoxGlyphHeight}"
                                Foreground="{DynamicResource CheckBoxGlyphFill}" />
                        </Panel>

                        <ContentPresenter
                            Name="PART_ContentPresenter"
                            Grid.Column="1"
                            Margin="{DynamicResource CheckBoxContentMargin}"
                            HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}"
                            VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}"
                            Content="{TemplateBinding Content}"
                            ContentTemplate="{TemplateBinding ContentTemplate}"
                            Foreground="{TemplateBinding Foreground}"
                            IsVisible="{TemplateBinding Content,Converter={x:Static ObjectConverters.IsNotNull}}"
                            FontSize="{TemplateBinding FontSize}"
                            RecognizesAccessKey="True"
                            TextWrapping="Wrap" />
                    </Grid>
                </Border>
            </ControlTemplate>
        </Setter>

        <!--  Unchecked Pointerover State  -->
        <Style Selector="^:pointerover">
            <Style Selector="^ /template/ Border#NormalRectangle">
                <Setter Property="BorderBrush" Value="{DynamicResource CheckBoxPointeroverBorderBrush}" />
            </Style>
            <Style Selector="^ /template/ Border#RootBorder">
                <Setter Property="Background" Value="{DynamicResource CheckBoxCardPointeroverBackground}" />
            </Style>
        </Style>

        <!--  Unchecked Pressed State  -->
        <Style Selector="^:pressed">
            <Style Selector="^ /template/ Border#NormalRectangle">
                <Setter Property="BorderBrush" Value="{DynamicResource CheckBoxPressedBorderBrush}" />
            </Style>
            <Style Selector="^ /template/ Border#RootBorder">
                <Setter Property="Background" Value="{DynamicResource CheckBoxCardPressedBackground}" />
            </Style>
        </Style>

        <!--  Unchecked Disabled state  -->
        <Style Selector="^:disabled">
            <Style Selector="^ /template/ ContentPresenter#PART_ContentPresenter">
                <Setter Property="Foreground" Value="{DynamicResource CheckBoxDisabledForeground}" />
            </Style>
            <Style Selector="^ /template/ Border#NormalRectangle">
                <Setter Property="BorderBrush" Value="{DynamicResource CheckBoxDefaultDisabledBorderBrush}" />
                <Setter Property="Background" Value="{DynamicResource CheckBoxDefaultDisabledBackground}" />
            </Style>
        </Style>

        <Style Selector="^:selected">
            <Style Selector="^ /template/ Border#RootBorder">
                <Setter Property="BorderBrush" Value="{DynamicResource CheckBoxCardCheckedBorderBrush}" />
                <Setter Property="Background" Value="{DynamicResource CheckBoxCardCheckedBackground}" />
            </Style>
            <Style Selector="^ /template/ Border#NormalRectangle">
                <Setter Property="BorderBrush" Value="{DynamicResource CheckBoxCheckedDefaultBorderBrush}" />
                <Setter Property="Background" Value="{DynamicResource CheckBoxCheckedDefaultBackground}" />
            </Style>

            <Style Selector="^ /template/ PathIcon#CheckGlyph">
                <Setter Property="Data" Value="{DynamicResource CheckBoxCheckGlyph}" />
                <Setter Property="Opacity" Value="1" />
            </Style>

            <!--  Checked Pointerover State  -->
            <Style Selector="^:pointerover">
                <Style Selector="^ /template/ Border#NormalRectangle">
                    <Setter Property="BorderBrush" Value="{DynamicResource CheckBoxCheckedPointeroverBorderBrush}" />
                    <Setter Property="Background" Value="{DynamicResource CheckBoxCheckedPointeroverBackground}" />
                </Style>
                <Style Selector="^ /template/ Border#RootBorder">
                    <Setter Property="BorderBrush" Value="{DynamicResource CheckBoxCardCheckedPointeroverBorderBrush}" />
                </Style>
            </Style>

            <!--  Checked Pressed State  -->
            <Style Selector="^:pressed">
                <Style Selector="^ /template/ Border#NormalRectangle">
                    <Setter Property="BorderBrush" Value="{DynamicResource CheckBoxCheckedPressedBorderBrush}" />
                    <Setter Property="Background" Value="{DynamicResource CheckBoxCheckedPressedBackground}" />
                </Style>
                <Style Selector="^ /template/ Border#RootBorder">
                    <Setter Property="BorderBrush" Value="{DynamicResource CheckBoxCardCheckedPressedBorderBrush}" />
                </Style>
            </Style>

            <!--  Checked Disabled State  -->
            <Style Selector="^:disabled">
                <Style Selector="^ /template/ Border#RootBorder">
                    <Setter Property="BorderBrush" Value="{DynamicResource CheckBoxCardCheckedDisabledBorderBrush}" />
                </Style>
                <Style Selector="^ /template/ ContentPresenter#PART_ContentPresenter">
                    <Setter Property="Foreground" Value="{DynamicResource CheckBoxDisabledForeground}" />
                </Style>
                <Style Selector="^ /template/ Border#NormalRectangle">
                    <Setter Property="BorderBrush" Value="{DynamicResource CheckBoxCheckedDisabledBorderBrush}" />
                    <Setter Property="Background" Value="{DynamicResource CheckBoxCheckedDisabledBackground}" />
                </Style>

                <Style Selector="^ /template/ Path#CheckGlyph">
                    <Setter Property="Fill" Value="{DynamicResource CheckBoxGlyphDisabledFill}" />
                </Style>
            </Style>
        </Style>
    </ControlTheme>
</ResourceDictionary>