in my XAML code, I have a TabControl with multiple items. The problem I have is that I can not center the tabitems about the content area. The tabs are always starting on th
Internally, the TabControl
uses a TabPanel
to layout the tabs. Using the default template, you just need to set the HorizontalAlignment
of the TabPanel
through a style:
<TabControl>
<TabControl.Resources>
<Style TargetType="{x:Type TabPanel}">
<Setter Property="HorizontalAlignment" Value="Center" />
</Style>
</TabControl.Resources>
<TabItem Header="Test 1" />
<TabItem Header="Test 2" />
<TabItem Header="Test 3" />
<TabItem Header="Test 4" />
</TabControl>