Question : Setting WPF radio button FontWeight based on Checked value

I'd like to databind the FontWeight property of a WPF radio button to its Checked value. For example in a collection of radio buttons, the one that is selected would have its text in bold.

Thanks.

Answer : Setting WPF radio button FontWeight based on Checked value

Just add below code to as part of your Resources. In example I have added under Windows Resources.

1:
2:
3:
4:
5:
6:
7:
8:
9:
 <Window.Resources>
        <Style TargetType="{x:Type RadioButton}">
            <Style.Triggers>
                <Trigger Property="IsChecked" Value="True">
                    <Setter Property="FontWeight" Value="Bold" />
                </Trigger>
            </Style.Triggers>
        </Style>
    </Window.Resources>
Random Solutions  
 
programming4us programming4us