I’ve tried:
<UniformGrid DockPanel.Dock="Top" Columns="2" Rows="1">
<UniformGrid.Resources>
<Style TargetType="RadioButton">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="RadioButton">
<TabItem IsSelected="{TemplateBinding IsChecked}">
<TabItem.Header>
<ContentPresenter Margin="5" />
</TabItem.Header>
</TabItem>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</UniformGrid.Resources>
<RadioButton Content="By company name" />
<RadioButton Content="By contact name" Grid.Column="1"/>
</UniformGrid>
It actually works except it doesn’t select/unselect the appropriate tab.
I would prefer RadioButtons of course, but my customer insist it should be Tabs.
I think the problem is that the TabItem is “eating” the mouseclick so the RadioButton never gets checked/unchecked. You could wrap the TabItem in a Border and set
IsHitTestVisible="False". Doing this you’ll lose the IsMouseOver trigger etc, so you’ll have to re-add them from the Default templateTry something like this
Update
Update 2
You could use an Attached Behavior to raise the MouseDown event on the RadioButton when the TabItem gets clicked. Alternatively you could just set IsChecked=”True” instead of raising the click-event
LinkWithRadioButtonBehavior