Using ToggleButtons as Radio Buttons RRS feed

  • Question

  • I have created a style which creates togglebuttons as RadioButtons.  It all pretty much works the way I want except the uncheck toggle works on checked items unlike the radio button operation where only selecting another item in group unchecks it.  I am searching for a way to modify the style to achieve this correction of operation.

       <Style TargetType="RadioButton" x:Key="RadioStyle2">
            <Setter Property="Background" Value="{ThemeResource ButtonBackground}" />
            <Setter Property="Foreground" Value="{ThemeResource ButtonForeground}" />
            <Setter Property="Template">
                    <ControlTemplate TargetType="RadioButton">
                        <ToggleButton HorizontalAlignment="Left" VerticalAlignment="Stretch" BorderThickness="1,1,5,5" BorderBrush="{StaticResource BorderBrush}" Width="{Binding Width, RelativeSource={RelativeSource TemplatedParent}}" IsChecked="{Binding IsChecked, RelativeSource={RelativeSource TemplatedParent}, Mode=TwoWay}"
                              Content="{Binding Content, RelativeSource={RelativeSource TemplatedParent}, Mode=TwoWay}" FontFamily="{Binding FontFamily, RelativeSource= {RelativeSource templatedParent}}" Foreground="{Binding Foreground, RelativeSource={RelativeSource TemplatedParent}}"
                              Background="{Binding Background, RelativeSource={RelativeSource TemplatedParent}}"/>

    Martin Autry

    Monday, September 11, 2017 8:25 PM


  • @Martin Autry

    Any updates?

    Have you solved your problem?

    Best regards,


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact

    Wednesday, September 13, 2017 1:11 AM

All replies