Reputation: 1630
The idea is to simply use the tabs (headers) to make a selection. So the "content" is unnecessary. And I can't seem to find an easy way to make the content "empty" or take up zero height.
So visually, you should only be presented with tabs, nothing else.
Upvotes: 3
Views: 2159
Reputation: 21
Another way to pull this off:
<TabControl Padding="0" BorderThickness="0">
<TabControl.ContentTemplate>
<DataTemplate>
<Grid/>
</DataTemplate>
</TabControl.ContentTemplate>
</TabControl>
Upvotes: 0
Reputation: 336
To hide the content of the tabs you can override the ContentTemplate of the TabControl.
<TabControl>
<TabControl.ContentTemplate>
<DataTemplate/>
</TabControl.ContentTemplate>
</TabControl>
Upvotes: 2
Reputation: 4671
You can use overlapped tab shaped buttons, you do not really need a tab control.
Here is how to create custom shaped buttons in WPF.
And here is how to create a tab shaped button.
Upvotes: 0
Reputation: 9694
Could you customise the ControlTemplate
from the MSDN example and remove the selected content: https://msdn.microsoft.com/en-us/library/ms754137(v=vs.90).aspx
So it would become something like this:
<Style TargetType="{x:Type TabControl}">
<Setter Property="OverridesDefaultStyle" Value="True" />
<Setter Property="SnapsToDevicePixels" Value="True" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type TabControl}">
<Grid KeyboardNavigation.TabNavigation="Local">
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<TabPanel
Name="HeaderPanel"
Grid.Row="0"
Panel.ZIndex="1"
Margin="0,0,4,-1"
IsItemsHost="True"
KeyboardNavigation.TabIndex="1"
Background="Transparent" />
</Grid>
<ControlTemplate.Triggers>
<Trigger Property="IsEnabled" Value="False">
<Setter Property="Foreground" Value="{StaticResource DisabledForegroundBrush}" />
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
Upvotes: 1