<!-- Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT License. See LICENSE in the project root for license information. -->
<ResourceDictionary
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="clr-namespace:ModernWpf.Controls"
    xmlns:primitives="clr-namespace:ModernWpf.Controls.Primitives">

    <Style TargetType="local:RadioButtons">
        <Setter Property="IsTabStop" Value="False" />
        <Setter Property="KeyboardNavigation.TabNavigation" Value="Once" />
        <Setter Property="KeyboardNavigation.DirectionalNavigation" Value="Contained" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="local:RadioButtons">
                    <StackPanel SnapsToDevicePixels="True">
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="CommonStates">
                                <VisualState x:Name="Normal" />
                                <VisualState x:Name="Disabled" />
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>
                        <ContentPresenter x:Name="HeaderContentPresenter"
                            Content="{TemplateBinding Header}"
                            ContentTemplate="{TemplateBinding HeaderTemplate}"
                            TextElement.Foreground="{DynamicResource RadioButtonsHeaderForeground}"
                            Margin="{DynamicResource RadioButtonsTopHeaderMargin}"
                            SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
                        <local:ItemsRepeater x:Name="InnerRepeater">
                            <local:ItemsRepeater.Layout>
                                <primitives:ColumnMajorUniformToLargestGridLayout
                                    ColumnSpacing="{DynamicResource RadioButtonsColumnSpacing}"
                                    RowSpacing="{DynamicResource RadioButtonsRowSpacing}" />
                            </local:ItemsRepeater.Layout>
                        </local:ItemsRepeater>
                    </StackPanel>
                    <ControlTemplate.Triggers>
                        <Trigger Property="IsEnabled" Value="False">
                            <Setter TargetName="HeaderContentPresenter" Property="TextElement.Foreground" Value="{DynamicResource RadioButtonsHeaderForegroundDisabled}" />
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

</ResourceDictionary>