Created
September 24, 2013 16:08
-
-
Save julesx/6687138 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<Window x:Class="WpfApplication4.MainWindow" | |
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | |
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | |
Title="MainWindow" Height="350" Width="525"> | |
<Grid> | |
<Grid.Resources> | |
<Style x:Key="HiddenTabItem" TargetType="{x:Type TabItem}"> | |
<!--<Setter Property="Visibility" Value="Visible"/>--> | |
<Setter Property="Template"> | |
<Setter.Value> | |
<ControlTemplate TargetType="{x:Type TabItem}"> | |
<Border x:Name="TabHeader" BorderThickness="1,1,0,1" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" Padding="{TemplateBinding Padding}"> | |
<ContentPresenter SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" HorizontalAlignment="{Binding Path=HorizontalContentAlignment, RelativeSource={RelativeSource AncestorType={x:Type ItemsControl}}}" VerticalAlignment="{Binding Path=VerticalContentAlignment, RelativeSource={RelativeSource AncestorType={x:Type ItemsControl}}}" ContentSource="Header" RecognizesAccessKey="True"/> | |
</Border> | |
<ControlTemplate.Triggers> | |
<Trigger SourceName="TabHeader" Property="IsMouseOver" Value="True"> | |
<Setter Property="Visibility" Value="Hidden" /> | |
</Trigger> | |
</ControlTemplate.Triggers> | |
</ControlTemplate> | |
</Setter.Value> | |
</Setter> | |
</Style> | |
</Grid.Resources> | |
<TabControl> | |
<TabItem Style="{StaticResource HiddenTabItem}" Header="Woo"></TabItem> | |
<TabItem Style="{StaticResource HiddenTabItem}" Header="Woo2"></TabItem> | |
<TabItem Style="{StaticResource HiddenTabItem}" Header="Woo3"></TabItem> | |
</TabControl> | |
</Grid> | |
</Window> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment