Circled Radio Buttons

image_pdfimage_print


   
      
<Page xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
      xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
    <Page.Resources>
        <ControlTemplate x:Key="newradio" 
                         TargetType="{x:Type RadioButton}">
            <Border Name="border" BorderBrush="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}"
                    Padding="10"
                    CornerRadius="100">
                <ContentPresenter />
            </Border>

            <ControlTemplate.Triggers>
                <Trigger Property="IsChecked" Value="True">
                    <Setter TargetName="border"
                            Property="BorderThickness"
                            Value="3" />
                </Trigger>
            </ControlTemplate.Triggers>
        </ControlTemplate>
    </Page.Resources>

    <GroupBox Header="Options" FontSize="20pt">
        <StackPanel>
            <RadioButton Template="{StaticResource newradio}"
                         HorizontalAlignment="Center" 
                         Content="1" />
            <RadioButton Template="{StaticResource newradio}"
                         HorizontalAlignment="Center"
                         Content="2"
                         IsChecked="True" />
            <RadioButton Template="{StaticResource newradio}"
                         HorizontalAlignment="Center"
                         Content="3" />
        </StackPanel>
    </GroupBox>
</Page>