Skip to content

Commit

Permalink
Added custom TabItem style, with some triggers to make Selected and n…
Browse files Browse the repository at this point in the history
…on-selected tabs look different (to make it easier to distinguish them from each other).
  • Loading branch information
perlun committed Apr 30, 2014
1 parent d0021be commit 1ad34ed
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions CefSharp.Wpf.Example/App.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,30 @@
</Setter>
</Style>

<Style TargetType="TabItem">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="TabItem">
<Border Name="Border" BorderThickness="1,1,1,0" BorderBrush="Gainsboro" Margin="2,0">
<ContentPresenter x:Name="ContentSite"
VerticalAlignment="Center"
HorizontalAlignment="Center"
ContentSource="Header"
Margin="10,2"/>
</Border>
<ControlTemplate.Triggers>
<Trigger Property="IsSelected" Value="True">
<Setter TargetName="Border" Property="Background" Value="LightSkyBlue" />
</Trigger>
<Trigger Property="IsSelected" Value="False">
<Setter TargetName="Border" Property="Background" Value="GhostWhite" />
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>

<DataTemplate DataType="{x:Type viewModel:BrowserTabViewModel}">
<view:BrowserTabView />
</DataTemplate>
Expand Down

0 comments on commit 1ad34ed

Please sign in to comment.