<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:ui="clr-namespace:GitHub.UI;assembly=GitHub.UI"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">

    <Style x:Key="LightModalViewTabControl" TargetType="{x:Type TabControl}">
        <Setter Property="Background" Value="Transparent" />
        <Setter Property="Padding" Value="2"/>
        <Setter Property="HorizontalContentAlignment" Value="Center"/>
        <Setter Property="VerticalContentAlignment" Value="Center"/>
        <Setter Property="BorderThickness" Value="0"/>
        <Setter Property="Focusable" Value="False"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type TabControl}">
                    <Grid
                        x:Name="templateRoot"
                        ClipToBounds="true"
                        SnapsToDevicePixels="true"
                        KeyboardNavigation.TabNavigation="Local"
                        Background="{TemplateBinding Background}">
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition x:Name="ColumnDefinition0"/>
                            <ColumnDefinition x:Name="ColumnDefinition1" Width="0"/>
                        </Grid.ColumnDefinitions>
                        <Grid.RowDefinitions>
                            <RowDefinition x:Name="RowDefinition0" Height="Auto"/>
                            <RowDefinition x:Name="RowDefinition1" Height="*"/>
                        </Grid.RowDefinitions>
                        <TabPanel
                            x:Name="headerPanel"
                            Grid.Row="0"
                            Grid.Column="0"
                            Width="Auto"
                            HorizontalAlignment="Center"
                            Panel.ZIndex="1"
                            IsItemsHost="true"
                            KeyboardNavigation.TabIndex="1" />
                            
                        <ContentPresenter
                            Grid.Row="1"
                            x:Name="PART_SelectedContentHost"
                            ContentSource="SelectedContent"
                            Margin="{TemplateBinding Padding}"
                            KeyboardNavigation.TabNavigation="Local"
                            KeyboardNavigation.DirectionalNavigation="Contained"
                            KeyboardNavigation.TabIndex="2"
                            SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"/>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style x:Key="LightModalViewTabItem" TargetType="{x:Type TabItem}">
        <Setter Property="Background" Value="Transparent" />
        <Setter Property="Foreground" Value="{DynamicResource VsBrush.WindowText}" />
        <Setter Property="Margin" Value="0,0,0,0"/>
        <Setter Property="Padding" Value="0,2,12,2"/>
        <Setter Property="HorizontalContentAlignment" Value="Stretch"/>
        <Setter Property="VerticalContentAlignment" Value="Stretch"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type TabItem}">
                    <Grid
                        x:Name="templateRoot"
                        Margin="{TemplateBinding Padding}"
                        SnapsToDevicePixels="true"
                        Background="{TemplateBinding Background}">
                        <Grid.RowDefinitions>
                            <RowDefinition Height="Auto" />
                            <RowDefinition Height="Auto" />
                        </Grid.RowDefinitions>

                        <TextBlock
                            x:Name="ContentSite"
                            VerticalAlignment="Center"
                            HorizontalAlignment="Center"
                            Foreground="{DynamicResource VsBrush.ControlLinkText}"
                            Text="{TemplateBinding Header}" />

                        <Rectangle
                            x:Name="TabHighlight"
                            Grid.Row="1"
                            Fill="{DynamicResource VsBrush.ControlLinkText}"
                            Margin="0"
                            Height="2"
                            Visibility="{Binding IsSelected, RelativeSource={RelativeSource AncestorType={x:Type TabItem}}, Converter={ui:BooleanToVisibilityConverter}}" />
                    </Grid>
                    <ControlTemplate.Triggers>
                        <Trigger Property="IsMouseOver" Value="True">
                            <Setter TargetName="ContentSite" Property="Foreground" Value="{DynamicResource VsBrush.ControlLinkTextHover}" />
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

</ResourceDictionary>