您可以指定边框的属性BorderThickness和CornerRadius,以每个侧面的单独值为基础,例如:
<Border CornerRadius="2,2,0,0" BorderThickness="2,2,2,0"/>
它将把左上角和右上角的圆角设置为2,左、上和右边框部分设置为2。
更新:
您还可以创建自定义Adorner。更多信息请参见此MSDN文章。
并且只需向TabItem控件模板添加一些自身大小的几何图形即可。有关此的更多信息,请参见此MSDN文章。
示例
<Style TargetType="{x:Type TabItem}">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type TabItem}">
<Grid>
<Viewbox Width="{TemplateBinding Width}" Height="{TemplateBinding Height}" Stretch="Fill" StretchDirection="DownOnly">
<Path x:Name="path" Stretch="Fill" Stroke="Black" Fill="{StaticResource LightBrush}" Width="Auto" Height="Auto" Data="M 0,20 L 0,5 5,0 100,0 100,20 "/>
</Viewbox>
<Border Visibility="Visible"
x:Name="Border"
Margin="5,1,0,1" >
<ContentPresenter x:Name="ContentSite"
VerticalAlignment="Center"
HorizontalAlignment="Center"
ContentSource="Header"
Margin="12,2,12,2"
RecognizesAccessKey="True"/>
</Border>
</Grid>
<ControlTemplate.Triggers>
<Trigger Property="IsSelected" Value="True">
<Setter Property="Panel.ZIndex" Value="100" />
<Setter TargetName="path" Property="Fill" Value="{StaticResource WindowBackgroundBrush}" />
</Trigger>
<Trigger Property="IsEnabled" Value="False">
<Setter TargetName="path" Property="Fill" Value="{StaticResource DisabledBackgroundBrush}" />
<Setter TargetName="path" Property="Stroke" Value="{StaticResource DisabledBorderBrush}" />
<Setter Property="Foreground" Value="{StaticResource DisabledForegroundBrush}" />
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>