<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:dragablz="clr-namespace:Dragablz"
                    xmlns:dockablz="clr-namespace:Dragablz.Dockablz"
                    xmlns:converters="clr-namespace:Dragablz.Converters">

    <BooleanToVisibilityConverter x:Key="BooleanToVisibilityConverter" />
    <converters:EqualityToVisibilityConverter x:Key="EqualityToVisibilityConverter" />
    <converters:BooleanAndToVisibilityConverter x:Key="BooleanAndToVisibilityConverter" />
    <converters:EqualityToBooleanConverter x:Key="EqualityToBooleanConverter" />
    <converters:ShowDefaultCloseButtonConverter x:Key="ShowDefaultCloseButtonConverter" />

    <Style x:Key="MahAppsFocusVisual">
        <Setter Property="Control.Template">
            <Setter.Value>
                <ControlTemplate>
                    <Rectangle Margin="2" SnapsToDevicePixels="true" Stroke="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}" StrokeThickness="1" StrokeDashArray="1 2"/>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style TargetType="{x:Type Thumb}" x:Key="MahAppsInvisibleThumbStyle">
        <Setter Property="Background" Value="Transparent" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate>
                    <Grid Background="{TemplateBinding Background}" />
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style TargetType="{x:Type Button}" x:Key="MahAppsMenuCommandButtonStyle">
        <Setter Property="FocusVisualStyle" Value="{StaticResource MahAppsFocusVisual}"/>
        <Setter Property="Background" Value="Transparent"/>
        <Setter Property="BorderBrush" Value="Transparent"/>
        <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}"/>
        <Setter Property="BorderThickness" Value="0"/>
        <Setter Property="HorizontalContentAlignment" Value="Center"/>
        <Setter Property="VerticalContentAlignment" Value="Center"/>
        <Setter Property="Padding" Value="1"/>
        <Setter Property="Opacity" Value=".8"/>
        <Setter Property="Width" Value="24"/>
        <Setter Property="Height" Value="20"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type Button}">
                    <Border x:Name="border" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" SnapsToDevicePixels="true">
                        <ContentPresenter x:Name="contentPresenter" Focusable="False" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="{TemplateBinding Padding}" RecognizesAccessKey="True" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
                    </Border>
                    <ControlTemplate.Triggers>
                        <Trigger Property="IsDefaulted" Value="true">
                            <Setter Property="BorderBrush" TargetName="border" Value="{DynamicResource {x:Static SystemColors.HighlightBrushKey}}"/>
                        </Trigger>
                        <Trigger Property="IsEnabled" Value="false">
                            <Setter Property="Opacity" TargetName="border" Value=".5"/>
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
        <Style.Triggers>
            <Trigger Property="IsMouseOver" Value="true">
                <Setter Property="Background" Value="{x:Static dragablz:DragablzColors.WindowGlassBrush}"/>
                <Setter Property="Foreground" Value="{x:Static SystemColors.HighlightTextBrush}" />
            </Trigger>
            <Trigger Property="IsPressed" Value="true">
                <Setter Property="Opacity" Value="1"/>
            </Trigger>
        </Style.Triggers>
    </Style>

    <Style TargetType="{x:Type Button}" x:Key="MahAppsCloseItemCommandButtonStyle" BasedOn="{StaticResource MahAppsMenuCommandButtonStyle}">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate>
                    <Grid>
                        <Ellipse Width="{TemplateBinding Width}"
                                 Height="{TemplateBinding Height}"
                                 Fill="{TemplateBinding Background}"/>
                        <Path x:Name="Path"
                              Data="M0.5,71 L70,0.5 M0.5,1 L70,70.5" 
                              Width="6" Height="6"
                              Stretch="Uniform"
                              Stroke="{TemplateBinding Foreground}"
                              StrokeThickness="1.5"
                              StrokeStartLineCap="Square" 
                              StrokeEndLineCap="Square"
                              SnapsToDevicePixels="True" />
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
        <Setter Property="Background">
            <Setter.Value>
                <SolidColorBrush Color="{x:Static SystemColors.ActiveBorderColor}" />
            </Setter.Value>
        </Setter>
        <Setter Property="Width" Value="12" />
        <Setter Property="Height" Value="12" />
        <Setter Property="Margin" Value="4 0 2 0" />
        <Setter Property="Opacity" Value=".75" />
        <Setter Property="Foreground" Value="{x:Static SystemColors.HighlightTextBrush}" />
        <Style.Triggers>
            <Trigger Property="IsMouseOver" Value="true">
                <Setter Property="Opacity" Value="1"/>
            </Trigger>
        </Style.Triggers>
    </Style>

    <Style TargetType="{x:Type Button}" x:Key="AddItemCommandButtonStyle" BasedOn="{StaticResource MahAppsMenuCommandButtonStyle}">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate>
                    <Grid>
                        <Ellipse Width="{TemplateBinding Width}"
                                 Height="{TemplateBinding Height}"
                                 Fill="{TemplateBinding Background}"/>
                        <Path x:Name="Path"
                              Data="M38,6L38.0003451911513,70.6666666666666 M70.3336667356886,38L5.50002465137562,38" 
                              Width="6" Height="6"
                              Stretch="Uniform"
                              Stroke="{TemplateBinding Foreground}"
                              StrokeThickness="1.5"
                              StrokeStartLineCap="Square" 
                              StrokeEndLineCap="Square"
                              SnapsToDevicePixels="True" />
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
        <Setter Property="Background">
            <Setter.Value>
                <SolidColorBrush Color="{x:Static SystemColors.ActiveBorderColor}" />
            </Setter.Value>
        </Setter>
        <Setter Property="Width" Value="12" />
        <Setter Property="Height" Value="12" />
        <Setter Property="Margin" Value="4 0 2 0" />
        <Setter Property="Foreground" Value="{x:Static SystemColors.HighlightTextBrush}" />
        <Style.Triggers>
            <Trigger Property="IsMouseOver" Value="true">
                <Setter Property="Background" Value="{x:Static dragablz:DragablzColors.WindowGlassBrush}"/>
                <Setter Property="Foreground" Value="{x:Static SystemColors.HighlightTextBrush}" />
            </Trigger>
            <Trigger Property="IsPressed" Value="true">
                <Setter Property="Opacity" Value="1"/>
            </Trigger>
        </Style.Triggers>
    </Style>

    <Style x:Key="MahAppsTrapezoidDragableTabItemStyle"  TargetType="{x:Type dragablz:DragablzItem}">
        <Setter Property="FocusVisualStyle" Value="{StaticResource MahAppsFocusVisual}"/>
        <Setter Property="Foreground" Value="{DynamicResource BlackBrush}"/>
        <Setter Property="Background" Value="Transparent"/>
        <Setter Property="BorderBrush" Value="Transparent"/>
        <Setter Property="Margin" Value="0 0 0 0"/>
        <Setter Property="HorizontalContentAlignment" Value="Stretch"/>
        <Setter Property="VerticalContentAlignment" Value="Stretch"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type dragablz:DragablzItem}">                    
                    <Grid x:Name="templateRoot" SnapsToDevicePixels="true" Margin="0 1 0 -1">
                        <dragablz:Trapezoid x:Name="Trapezoid" 
                                            BorderBrush="{TemplateBinding BorderBrush}" 
                                            Background="{TemplateBinding Background}"                                          
                                            LongBasePenBrush="{TemplateBinding Background}"                                          
                                            PenThickness="0"
                                            Margin="0 0 0 0">                            
                            <Grid>
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition Width="*" />
                                    <ColumnDefinition Width="Auto" />
                                </Grid.ColumnDefinitions>
                                <ContentPresenter Content="{TemplateBinding ContentControl.Content}" ContentTemplate="{TemplateBinding ContentControl.ContentTemplate}" ContentStringFormat="{TemplateBinding ContentControl.ContentStringFormat}" HorizontalAlignment="{TemplateBinding Control.HorizontalContentAlignment}" VerticalAlignment="{TemplateBinding Control.VerticalContentAlignment}" SnapsToDevicePixels="{TemplateBinding UIElement.SnapsToDevicePixels}"
                                                  Margin="{TemplateBinding Control.Padding }"
                                                  x:Name="contentPresenter" />                                    
                                <Thumb Grid.Column="0" HorizontalAlignment="Stretch" VerticalContentAlignment="Stretch" 
                                       x:Name="PART_Thumb"
                                       Style="{StaticResource MahAppsInvisibleThumbStyle}" />
                                <Button Grid.Column="1"
                                        Style="{StaticResource MahAppsCloseItemCommandButtonStyle}"                                        
                                        Command="{x:Static dragablz:TabablzControl.CloseItemCommand}"
                                        CommandParameter="{Binding RelativeSource={RelativeSource TemplatedParent}}">
                                    <Button.Visibility>
                                        <MultiBinding Converter="{StaticResource ShowDefaultCloseButtonConverter}">
                                            <Binding RelativeSource="{RelativeSource FindAncestor, AncestorType={x:Type dragablz:TabablzControl}}" Path="ShowDefaultCloseButton" />
                                            <Binding RelativeSource="{RelativeSource FindAncestor, AncestorType={x:Type dragablz:TabablzControl}}" Path="FixedHeaderCount" />
                                            <Binding RelativeSource="{RelativeSource TemplatedParent}" Path="LogicalIndex" />
                                        </MultiBinding>
                                    </Button.Visibility>
                                </Button>
                            </Grid>
                        </dragablz:Trapezoid>
                    </Grid>
                    <ControlTemplate.Triggers>
                        <Trigger Property="dragablz:TabablzControl.IsWrappingTabItem" Value="True">
                            <Setter TargetName="contentPresenter" Property="Content" Value="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=DataContext.Header}" />
                        </Trigger>
                        <Trigger Property="IsMouseOver" Value="True">
                            <Setter Property="Background" Value="{DynamicResource AccentColorBrush3}" TargetName="Trapezoid"/>
                            <Setter Property="LongBasePenBrush" Value="{DynamicResource AccentColorBrush3}" TargetName="Trapezoid"/>
                        </Trigger>
                        <Trigger Property="IsSelected" Value="True">
                            <Setter Property="Background" Value="{DynamicResource AccentColorBrush}" TargetName="Trapezoid"/>
                            <Setter Property="LongBasePenBrush" Value="{DynamicResource AccentColorBrush}" TargetName="Trapezoid"/>
                            <Setter Property="Foreground" Value="{DynamicResource WhiteBrush}"/>
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style x:Key="MahAppsMetroBaseWindowButtonStyle" TargetType="{x:Type Button}">
        <Setter Property="Background" Value="{DynamicResource TransparentWhiteBrush}" />
        <Setter Property="Foreground" Value="{DynamicResource WhiteColorBrush}" />
        <Setter Property="HorizontalContentAlignment" Value="Center" />
        <Setter Property="VerticalContentAlignment" Value="Center" />
        <Setter Property="Padding" Value="1" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type Button}">
                    <Grid Background="{TemplateBinding Background}">
                        <ContentPresenter x:Name="contentPresenter"
                                          HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
                                          Margin="{TemplateBinding Padding}"
                                          VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
                                          SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"
                                          RecognizesAccessKey="True"
                                          Opacity="0.75" />
                    </Grid>
                    <ControlTemplate.Triggers>
                        <Trigger Property="IsMouseOver" Value="True">
                            <Setter TargetName="contentPresenter" Property="Opacity" Value="1" />
                        </Trigger>
                        <Trigger Property="IsMouseOver" Value="False">
                            <Setter TargetName="contentPresenter" Property="Opacity" Value=".5" />
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
        <Style.Triggers>
            <Trigger Property="IsMouseOver" Value="True">
                <Setter Property="Background" Value="{DynamicResource SemiTransparentWhiteBrush}" />
            </Trigger>
            <Trigger Property="IsPressed" Value="True">
                <Setter Property="Background" Value="{DynamicResource HighlightBrush}" />
                <Setter Property="Foreground" Value="White" />
            </Trigger>
            <Trigger Property="IsEnabled" Value="false">
                <Setter Property="Foreground" Value="#ADADAD" />
            </Trigger>
        </Style.Triggers>
    </Style>

    <Style x:Key="MahAppsToolWindowButtonStyle" TargetType="{x:Type Button}" BasedOn="{StaticResource MahAppsMetroBaseWindowButtonStyle}">
        <Setter Property="FocusVisualStyle" Value="{x:Null}" />
        <Setter Property="IsTabStop" Value="False" />
        <Setter Property="Width" Value="30" />
        <Setter Property="MaxHeight" Value="30" />
        <Setter Property="Padding" Value="0" />
        <Style.Triggers>
            <Trigger Property="IsEnabled" Value="False">
                <Setter Property="Visibility" Value="Collapsed" />
            </Trigger>
        </Style.Triggers>
    </Style>

    <Style TargetType="{x:Type dragablz:HeaderedDragablzItem}" x:Key="MahAppsToolDragablzItemStyle">
        <Style.Setters>
            <Setter Property="BorderBrush" Value="{DynamicResource AccentColorBrush2}" />
            <Setter Property="BorderThickness" Value="4" />
            <Setter Property="Canvas.Left" Value="{Binding X, RelativeSource={RelativeSource Self}}" />
            <Setter Property="Canvas.Top" Value="{Binding Y, RelativeSource={RelativeSource Self}}" />
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="{x:Type dragablz:HeaderedDragablzItem}">
                        <Grid Margin="{TemplateBinding Margin}">
                            <Border Background="{DynamicResource WhiteColorBrush}">
                                <Border.Effect>
                                    <DropShadowEffect BlurRadius="10" ShadowDepth="5" Direction="315" Color="{DynamicResource AccentColor2}" Opacity=".5" />
                                </Border.Effect>
                            </Border>
                            <Border BorderThickness="{TemplateBinding Border.BorderThickness}" Padding="{TemplateBinding Control.Padding}" BorderBrush="{TemplateBinding Border.BorderBrush}" Background="{TemplateBinding Panel.Background}" SnapsToDevicePixels="True">
                                <DockPanel>
                                    <Grid DockPanel.Dock="Top" Background="{TemplateBinding BorderBrush}">
                                        <Thumb HorizontalAlignment="Stretch" VerticalContentAlignment="Stretch" x:Name="PART_Thumb"
                                               Style="{StaticResource MahAppsInvisibleThumbStyle}"
                                               />
                                        <DockPanel Margin="{TemplateBinding Control.Padding }">
                                            <Button DockPanel.Dock="Right"
                                                    Command="{x:Static dockablz:Layout.CloseFloatingItem}"
                                                    CommandParameter="{Binding RelativeSource={RelativeSource TemplatedParent}}"
                                                    Margin="1 0 0 0"
                                                    Style="{DynamicResource MahAppsToolWindowButtonStyle}"
                                                    Focusable="False"
                                                    RenderOptions.EdgeMode="Aliased"
                                                    >
                                                <Path Data="M 10.009,1.704 L 8.331,0.026 5.03,3.327 1.703,0 0,1.704 3.326,5.031 0.025,8.332 1.703,10.009 5.004,6.708 8.305,10.009 10.009,8.305 6.708,5.005"
                                                      SnapsToDevicePixels="True"
                                                      Fill="{Binding Path=Foreground, RelativeSource={RelativeSource AncestorType=Button}}" />
                                            </Button>
                                            <Button DockPanel.Dock="Right"
                                                    Command="{x:Static dockablz:Layout.UnfloatItemCommand}"
                                                    CommandParameter="{Binding RelativeSource={RelativeSource TemplatedParent}}"
                                                    Margin="1 0 0 0"
                                                    Style="{DynamicResource MahAppsToolWindowButtonStyle}"
                                                    >
                                                <Path Width="12" Height="12" Stretch="UniformToFill" Fill="{Binding Path=Foreground, RelativeSource={RelativeSource AncestorType=Button}}" Data="M 19 19 H 5 V 5 h 7 V 3 H 5 C 3.89 3 3 3.9 3 5 v 14 c 0 1.1 0.89 2 2 2 h 14 c 1.1 0 2 -0.9 2 -2 v -7 h -2 v 7 z M 14 3 v 2 h 3.59 L 7.76 14.83 9.17 16.24 19 6.41 V 10 h 2 V 3 h -7 z" />
                                            </Button>
                                            <Button DockPanel.Dock="Right"
                                                    Command="{x:Static dockablz:Layout.MaximiseFloatingItem}"
                                                    CommandParameter="{Binding RelativeSource={RelativeSource TemplatedParent}}"
                                                    Margin="1 0 0 0"
                                                    Style="{DynamicResource MahAppsToolWindowButtonStyle}"
                                                    >
                                                <Path Width="10"
                                                      Height="10"
                                                      Data="F1M0,0L0,9 9,9 9,0 0,0 0,3 8,3 8,8 1,8 1,3z"
                                                      SnapsToDevicePixels="True"
                                                      Fill="{Binding Path=Foreground, RelativeSource={RelativeSource AncestorType=Button}}" />
                                            </Button>
                                            <Button DockPanel.Dock="Right"
                                                    Command="{x:Static dockablz:Layout.RestoreFloatingItem}"
                                                    CommandParameter="{Binding RelativeSource={RelativeSource TemplatedParent}}"
                                                    Margin="1 0 0 0"
                                                    Style="{DynamicResource MahAppsToolWindowButtonStyle}"
                                                    >
                                                <Path Width="10"
                                                      Height="10"
                                                      Data="F1M0,10L0,3 3,3 3,0 10,0 10,2 4,2 4,3 7,3 7,6 6,6 6,5 1,5 1,10z M1,10L7,10 7,7 10,7 10,2 9,2 9,6 6,6 6,9 1,9z"
                                                      SnapsToDevicePixels="True"
                                                      Fill="{Binding Path=Foreground, RelativeSource={RelativeSource AncestorType=Button}}" />
                                            </Button>
                                            <ContentPresenter Content="{TemplateBinding HeaderContent}"                                                               
                                                              ContentTemplate="{TemplateBinding HeaderContentTemplate}" 
                                                              ContentStringFormat="{TemplateBinding ContentControl.ContentStringFormat}" HorizontalAlignment="{TemplateBinding Control.HorizontalContentAlignment}" 
                                                              ContentTemplateSelector="{TemplateBinding HeaderContentTemplateSelector}"                                                          
                                                              SnapsToDevicePixels="{TemplateBinding UIElement.SnapsToDevicePixels}"
                                                              IsHitTestVisible="False"
                                                          />
                                        </DockPanel>
                                    </Grid>
                                    <ContentPresenter Content="{TemplateBinding ContentControl.Content}" ContentTemplate="{TemplateBinding ContentControl.ContentTemplate}" ContentStringFormat="{TemplateBinding ContentControl.ContentStringFormat}" HorizontalAlignment="{TemplateBinding Control.HorizontalContentAlignment}" VerticalAlignment="{TemplateBinding Control.VerticalContentAlignment}" SnapsToDevicePixels="{TemplateBinding UIElement.SnapsToDevicePixels}"
                                                      Margin="{TemplateBinding Control.Padding }"/>
                                </DockPanel>
                            </Border>
                            <Thumb Style="{StaticResource MahAppsInvisibleThumbStyle}"
                                   Width="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=BorderThickness.Left}"
                                   IsEnabled="{Binding Path=(dockablz:Layout.FloatingItemState), RelativeSource={RelativeSource TemplatedParent}, Converter={StaticResource EqualityToBooleanConverter}, ConverterParameter={x:Static WindowState.Normal}}"
                                   dragablz:DragablzItem.SizeGrip="Left"
                                   HorizontalAlignment="Left"
                                   VerticalAlignment="Stretch"
                                   Cursor="SizeWE"
                                   />
                            <Thumb Style="{StaticResource MahAppsInvisibleThumbStyle}"
                                   Height="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=BorderThickness.Top}"
                                   IsEnabled="{Binding Path=(dockablz:Layout.FloatingItemState), RelativeSource={RelativeSource TemplatedParent}, Converter={StaticResource EqualityToBooleanConverter}, ConverterParameter={x:Static WindowState.Normal}}"
                                   dragablz:DragablzItem.SizeGrip="Top"
                                   HorizontalAlignment="Stretch"
                                   VerticalAlignment="Top"
                                   Cursor="SizeNS"
                                   />
                            <Thumb Style="{StaticResource MahAppsInvisibleThumbStyle}"
                                   Width="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=BorderThickness.Right}"
                                   IsEnabled="{Binding Path=(dockablz:Layout.FloatingItemState), RelativeSource={RelativeSource TemplatedParent}, Converter={StaticResource EqualityToBooleanConverter}, ConverterParameter={x:Static WindowState.Normal}}"
                                   dragablz:DragablzItem.SizeGrip="Right"
                                   HorizontalAlignment="Right"
                                   VerticalAlignment="Stretch"
                                   Cursor="SizeWE"
                                   />
                            <Thumb Style="{StaticResource MahAppsInvisibleThumbStyle}"
                                   Height="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=BorderThickness.Bottom}"
                                   IsEnabled="{Binding Path=(dockablz:Layout.FloatingItemState), RelativeSource={RelativeSource TemplatedParent}, Converter={StaticResource EqualityToBooleanConverter}, ConverterParameter={x:Static WindowState.Normal}}"
                                   dragablz:DragablzItem.SizeGrip="Bottom"
                                   HorizontalAlignment="Stretch"
                                   VerticalAlignment="Bottom"
                                   Cursor="SizeNS"
                                   />
                            <Thumb Style="{StaticResource MahAppsInvisibleThumbStyle}"
                                   Width="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=BorderThickness.Right}"
                                   Height="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=BorderThickness.Bottom}"
                                   IsEnabled="{Binding Path=(dockablz:Layout.FloatingItemState), RelativeSource={RelativeSource TemplatedParent}, Converter={StaticResource EqualityToBooleanConverter}, ConverterParameter={x:Static WindowState.Normal}}"
                                   dragablz:DragablzItem.SizeGrip="TopLeft"
                                   HorizontalAlignment="Left"
                                   VerticalAlignment="Top"
                                   Cursor="SizeNWSE"
                                   />
                            <Thumb Style="{StaticResource MahAppsInvisibleThumbStyle}"
                                   Width="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=BorderThickness.Right}"
                                   Height="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=BorderThickness.Bottom}"
                                   IsEnabled="{Binding Path=(dockablz:Layout.FloatingItemState), RelativeSource={RelativeSource TemplatedParent}, Converter={StaticResource EqualityToBooleanConverter}, ConverterParameter={x:Static WindowState.Normal}}"
                                   dragablz:DragablzItem.SizeGrip="TopRight"
                                   HorizontalAlignment="Right"
                                   VerticalAlignment="Top"
                                   Cursor="SizeNESW"
                                   />
                            <Thumb Style="{StaticResource MahAppsInvisibleThumbStyle}"
                                   Width="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=BorderThickness.Right}"
                                   Height="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=BorderThickness.Bottom}"
                                   IsEnabled="{Binding Path=(dockablz:Layout.FloatingItemState), RelativeSource={RelativeSource TemplatedParent}, Converter={StaticResource EqualityToBooleanConverter}, ConverterParameter={x:Static WindowState.Normal}}"
                                   dragablz:DragablzItem.SizeGrip="BottomRight"
                                   HorizontalAlignment="Right"
                                   VerticalAlignment="Bottom"
                                   Cursor="SizeNWSE"
                                   />
                            <Thumb Style="{StaticResource MahAppsInvisibleThumbStyle}"
                                   Width="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=BorderThickness.Right}"
                                   Height="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=BorderThickness.Bottom}"
                                   IsEnabled="{Binding Path=(dockablz:Layout.FloatingItemState), RelativeSource={RelativeSource TemplatedParent}, Converter={StaticResource EqualityToBooleanConverter}, ConverterParameter={x:Static WindowState.Normal}}"
                                   dragablz:DragablzItem.SizeGrip="BottomLeft"                                   
                                   HorizontalAlignment="Left"
                                   VerticalAlignment="Bottom"
                                   Cursor="SizeNESW"
                                   />
                        </Grid>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style.Setters>
        <Style.Triggers>
            <Trigger Property="dockablz:Layout.FloatingItemState" Value="Maximized">
                <Setter Property="BorderThickness" Value="1" />
                <Setter Property="Canvas.Left" Value="0" />
                <Setter Property="Canvas.Top" Value="0" />
                <Setter Property="Width" Value="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type dockablz:Layout}}, Path=ActualWidth}" />
                <Setter Property="Height" Value="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type dockablz:Layout}}, Path=ActualHeight}" />
            </Trigger>
        </Style.Triggers>
    </Style>    

    <Style TargetType="{x:Type dragablz:TabablzControl}" x:Key="MahAppsTabablzControlStyle">
        <Setter Property="Background" Value="{DynamicResource WhiteColorBrush}"/>
        <Setter Property="BorderBrush" Value="{DynamicResource AccentColorBrush}"/>
        <Setter Property="Foreground" Value="{DynamicResource BlackColorBrush}"/>
        <Setter Property="AdjacentHeaderItemOffset" Value="-12" />
        <Setter Property="ItemContainerStyle" Value="{StaticResource MahAppsTrapezoidDragableTabItemStyle}" />        
    </Style>

</ResourceDictionary>