0
我在我的應用程序中使用tabcontrol作爲菜單。我想要它的樣式和項目標題看起來很棒。問題在於這會在「內容」區域中產生影響,但這不是我想要的。WPF ItemTab Style
這是在我的窗口
<TabControl Name="Tab_Content" Grid.Row="1" TabStripPlacement="Left" >
<TabControl.Resources>
<Style TargetType="TabItem">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="TabItem">
<Grid Name="Panel">
<ContentPresenter x:Name="ContentSite"
VerticalAlignment="Center"
HorizontalAlignment="Left"
ContentSource="Header"
Height="25"
Margin="5,10,0,0" Width="150" />
</Grid>
<ControlTemplate.Triggers>
<Trigger Property="IsSelected" Value="True">
<Setter Property="Foreground" Value="Blue" />
<Setter Property="FontWeight" Value="Bold" />
<Setter TargetName="Panel" Property="Background" Value="White" />
</Trigger>
<Trigger Property="IsSelected" Value="False">
<Setter Property="Foreground" Value="Black" />
<Setter TargetName="Panel" Property="Background" Value="White" />
</Trigger>
<Trigger Property="IsMouseOver" Value="True">
<Setter Property="Foreground" Value="White" />
<Setter TargetName="Panel" Property="Background" Value="Blue" />
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</TabControl.Resources>
<TabItem Name="item_Home" Header="Home" >
<Grid>
<Label Name="Test" Content="hello" />
</Grid>
</TabItem>
代碼這是怎麼來看看:
有沒有辦法來seperatly樣式的內容區域?