<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:converter1="clr-namespace:Valg.EVA.Skanning.Assets.Converter">
    <ResourceDictionary.MergedDictionaries>
        <ResourceDictionary Source="../BaseControlStyles/TextBlockStyle.xaml"></ResourceDictionary>
    </ResourceDictionary.MergedDictionaries>
    <SolidColorBrush x:Key="BorderBrush" Color="Gray" />
    <SolidColorBrush x:Key="ForegroundBrush" Color="White" />
    <SolidColorBrush x:Key="HoverBrush" Color="DarkGray" />
    <SolidColorBrush x:Key="TabControlBackgroundBrush" Color="Black" />
    <SolidColorBrush x:Key="TabItemPathBrush" Color="#333333" />

    <PathGeometry x:Key="SelectedPathGeometry">
        <PathFigureCollection>
            <PathFigure StartPoint="0,60">
                <PathFigure.Segments>
                    <PathSegmentCollection>
                        <LineSegment Point="50,5" />
                        <ArcSegment Size="15,15" RotationAngle="0" IsLargeArc="False" SweepDirection="Clockwise" Point="60,0" />
                        <LineSegment Point="300,0" />
                        <ArcSegment Size="10,10" RotationAngle="0" IsLargeArc="False" SweepDirection="Clockwise" Point="305,5" />
                        <LineSegment Point="305,60" />
                    </PathSegmentCollection>
                </PathFigure.Segments>
            </PathFigure>
        </PathFigureCollection>
    </PathGeometry>

    <PathGeometry x:Key="PassivePathGeometry">
        <PathFigureCollection>
            <PathFigure StartPoint="0,60">
                <PathFigure.Segments>
                    <PathSegmentCollection>
                        <LineSegment Point="50,15" />
                        <ArcSegment Size="15,15" RotationAngle="0" IsLargeArc="False" SweepDirection="Clockwise" Point="60,10" />
                        <LineSegment Point="300,10" />
                        <ArcSegment Size="10,10" RotationAngle="0" IsLargeArc="False" SweepDirection="Clockwise" Point="305,15" />
                        <LineSegment Point="305,60" />
                    </PathSegmentCollection>
                </PathFigure.Segments>
            </PathFigure>
        </PathFigureCollection>
    </PathGeometry><Style x:Key="BlackAndWhiteTabControlStyle" TargetType="{x:Type TabControl}">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="TabControl">
                    <Grid>
                        <Grid.RowDefinitions>
                            <RowDefinition Height="Auto" />
                            <RowDefinition Height="*" />
                        </Grid.RowDefinitions>
                        <ContentPresenter Grid.Row="1" ContentSource="SelectedContent" />
                        <Grid Grid.Row="0">
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="*" />
                                <ColumnDefinition Width="*" />
                            </Grid.ColumnDefinitions>
                            <StackPanel Grid.Column="0" Orientation="Horizontal" Panel.ZIndex="1" IsItemsHost="true" />
                            <Rectangle Grid.Column="1" Width="auto"  Height="1" Visibility="Visible" VerticalAlignment="Bottom" Fill="{StaticResource BorderBrush}" />
                        </Grid>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style><Style x:Key="BlackAndWhiteTabItemStyle" TargetType="{x:Type TabItem}">
        <Setter Property="SnapsToDevicePixels" Value="True" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type TabItem}">
                    <Grid x:Name="grd" Margin="0 0 -40 0" Cursor="Hand">

                        <Path x:Name="TabPath"
                              StrokeThickness="1"
                              Margin="{Binding ElementName=TabItemContent, Converter={x:Static converter1:ContentToMarginConverter.Value}}"
                              Stroke="{StaticResource BorderBrush}"
                              Fill="{StaticResource TabItemPathBrush}"
                              Data="{StaticResource PassivePathGeometry}">
                        </Path>
                        <Rectangle x:Name="TabItemBottomBorder"
                                   Height="1"
                                   Visibility="Visible"
                                   VerticalAlignment="Bottom" Fill="{StaticResource BorderBrush}" Margin="{Binding ElementName=TabPath, Path=Margin}" />
                        <ContentPresenter x:Name="TabItemContent"
                                          ContentSource="Header"
                                          Margin="50,2,10,2"
                                          VerticalAlignment="Center"
                                          HorizontalAlignment="Center"
                                          TextElement.Foreground="{StaticResource ForegroundBrush}">
                            <ContentPresenter.Resources>
                                <Style BasedOn="{StaticResource TextBlockNormal}" TargetType="TextBlock">
                                    <Setter Property="FontSize" Value="16"></Setter>
                                </Style>
                            </ContentPresenter.Resources>
                        </ContentPresenter>
                    </Grid>
                    <ControlTemplate.Triggers>
                        <Trigger Property="IsMouseOver" Value="True" SourceName="grd">
                            <Setter Property="Stroke" Value="{StaticResource HoverBrush}" TargetName="TabPath" />
                        </Trigger>
                        <Trigger Property="Selector.IsSelected" Value="True">
                            <Setter Property="Data" Value="{StaticResource SelectedPathGeometry}" TargetName="TabPath" />
                            <Setter Property="Fill" TargetName="TabPath" Value="White" />
                            <Setter Property="TextElement.Foreground" Value="Black" TargetName="TabItemContent" />
                            <Setter Property="Margin" Value="50,-1,10,2" TargetName="TabItemContent" />
                            <Setter Property="Panel.ZIndex" Value="2" />
                            <Setter Property="Fill" Value="White" TargetName="TabItemBottomBorder" />
                            <Setter Property="Focusable" Value="False" />
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
</ResourceDictionary>
