2

Its clear that by default a RadioButton's GroupName is scoped to the parent container. In this case, two RadioButtons each placed at different tab of TabControl will not be grouped together. Check the following example as an instance

<Grid>
    <TabControl>
        <TabItem Header="TabItem">
            <Grid>
                <RadioButton GroupName="A" Content="RB 1"/>
            </Grid>
        </TabItem>
        <TabItem Header="TabItem">
            <Grid>
                <RadioButton GroupName="A" Content="RB 2"/>
            </Grid>
        </TabItem>
    </TabControl>
</Grid>

I was wondering how would it be possible to extend the GroupName scope so that when RB 1 is checked, RB 2 will be un-checked and visa-versa.

I came across interesting solutions such as this question which works by Binding the IsChecked property of RadioButtons to a converter. Although it works perfectly, but I would prefer extending the GroupName scope somehow.

Dr. Strangelove
  • 2,725
  • 3
  • 34
  • 61
  • 2
    In my case, GroupName attribute shared through the whole application. When I create new instance of UserControl containing RadioButton, the RadioButtons of previous UserControl got unchecked. – Soohwan Park May 07 '19 at 09:39

0 Answers0