<!-- Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT License. See LICENSE in the project root for license information. -->
<ResourceDictionary
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:ui="http://schemas.modernwpf.com/2019"
    xmlns:dragablz="http://dragablz.net/winfx/xaml/dragablz"
    xmlns:converters="clr-namespace:Dragablz.Converters;assembly=Dragablz"
    xmlns:local="clr-namespace:DragablzSample">

    <ResourceDictionary.MergedDictionaries>
        <ResourceDictionary Source="/ModernWpf;component/Styles/Button.xaml" />
        <ResourceDictionary Source="/ModernWpf;component/Styles/ScrollViewer.xaml" />
    </ResourceDictionary.MergedDictionaries>

    <BooleanToVisibilityConverter x:Key="BooleanToVisibilityConverter" />
    <converters:ShowDefaultCloseButtonConverter x:Key="ShowDefaultCloseButtonConverter" />
    <ui:CornerRadiusFilterConverter x:Key="TopCornerRadiusFilterConverter" Filter="Top" />
    <local:InvertThicknessConverter x:Key="InvertThicknessConverter" />

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

    <Style x:Key="TabViewButtonStyle" TargetType="Button" BasedOn="{StaticResource DefaultButtonStyle}">
        <Setter Property="Background" Value="{DynamicResource TabViewButtonBackground}" />
        <Setter Property="Foreground" Value="{DynamicResource TabViewButtonForeground}" />
        <Setter Property="ui:ControlHelper.CornerRadius" Value="{DynamicResource OverlayCornerRadius}" />
        <Setter Property="FontSize" Value="11" />
        <Setter Property="FontFamily" Value="{DynamicResource SymbolThemeFontFamily}" />
        <Setter Property="VerticalAlignment" Value="Bottom" />
        <Setter Property="Margin" Value="0,7,0,0" />
        <Setter Property="Padding" Value="10,10,10,11" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="Button">
                    <Border
                        x:Name="Background"
                        Background="{TemplateBinding Background}"
                        CornerRadius="{TemplateBinding ui:ControlHelper.CornerRadius, Converter={StaticResource TopCornerRadiusFilterConverter}}"
                        Padding="{TemplateBinding Padding}">
                        <ContentPresenter
                            x:Name="ContentPresenter"
                            Content="{TemplateBinding Content}"
                            ContentTemplate="{TemplateBinding ContentTemplate}"
                            TextElement.FontSize="{TemplateBinding FontSize}"
                            TextElement.FontFamily="{TemplateBinding FontFamily}"
                            TextElement.FontWeight="350"
                            HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
                            VerticalAlignment="{TemplateBinding VerticalContentAlignment}" />
                    </Border>

                    <ControlTemplate.Triggers>
                        <!-- PointerOver -->
                        <Trigger Property="IsMouseOver" Value="True">
                            <Setter TargetName="Background" Property="Background" Value="{DynamicResource TabViewItemHeaderBackgroundPointerOver}" />
                            <Setter TargetName="ContentPresenter" Property="TextElement.Foreground" Value="{DynamicResource TabViewItemHeaderForegroundPointerOver}" />
                        </Trigger>
                        <!-- Pressed -->
                        <Trigger Property="IsPressed" Value="True">
                            <Setter TargetName="Background" Property="Background" Value="{DynamicResource TabViewItemHeaderBackgroundPressed}" />
                            <Setter TargetName="ContentPresenter" Property="TextElement.Foreground" Value="{DynamicResource TabViewItemHeaderForegroundPressed}" />
                        </Trigger>
                        <!-- Disabled -->
                        <Trigger Property="IsEnabled" Value="False">
                            <Setter TargetName="Background" Property="Background" Value="{DynamicResource TabViewButtonBackgroundDisabled}" />
                            <Setter TargetName="ContentPresenter" Property="TextElement.Foreground" Value="{DynamicResource TabViewButtonForegroundDisabled}" />
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style x:Key="TabViewCloseButtonStyle" TargetType="Button" BasedOn="{StaticResource DefaultButtonStyle}">
        <Setter Property="BorderThickness" Value="0" />
        <Setter Property="Padding" Value="0" />
        <Setter Property="HorizontalAlignment" Value="Left" />
        <Setter Property="VerticalAlignment" Value="Center" />
        <Setter Property="FontFamily" Value="{DynamicResource SymbolThemeFontFamily}" />
        <Setter Property="FontWeight" Value="Normal" />
        <Setter Property="FontSize" Value="{DynamicResource ControlContentThemeFontSize}" />
        <Setter Property="ui:ControlHelper.CornerRadius" Value="{DynamicResource ControlCornerRadius}" />
        <Setter Property="ui:FocusVisualHelper.UseSystemFocusVisuals" Value="{DynamicResource UseSystemFocusVisuals}" />
        <Setter Property="ui:FocusVisualHelper.FocusVisualMargin" Value="-3" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="Button">
                    <Border
                        x:Name="Background"
                        Background="{TemplateBinding Background}"
                        BorderThickness="{TemplateBinding BorderThickness}"
                        BorderBrush="{TemplateBinding BorderBrush}"
                        CornerRadius="{TemplateBinding ui:ControlHelper.CornerRadius}"
                        Padding="{TemplateBinding Padding}"
                        SnapsToDevicePixels="True">
                        <ContentPresenter
                            x:Name="ContentPresenter"
                            HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
                            VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
                            Focusable="False"
                            RecognizesAccessKey="True"
                            SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
                    </Border>

                    <ControlTemplate.Triggers>
                        <!-- PointerOver -->
                        <Trigger Property="IsMouseOver" Value="True">
                            <Setter TargetName="Background" Property="Background" Value="{DynamicResource TabViewButtonBackgroundPointerOver}" />
                            <Setter TargetName="ContentPresenter" Property="TextElement.Foreground" Value="{DynamicResource TabViewButtonForegroundPointerOver}" />
                        </Trigger>
                        <!-- Pressed -->
                        <Trigger Property="IsPressed" Value="True">
                            <Setter TargetName="Background" Property="Background" Value="{DynamicResource TabViewButtonBackgroundPressed}" />
                            <Setter TargetName="ContentPresenter" Property="TextElement.Foreground" Value="{DynamicResource TabViewButtonForegroundPressed}" />
                        </Trigger>
                        <!-- Disabled -->
                        <Trigger Property="IsEnabled" Value="False">
                            <Setter TargetName="Background" Property="Background" Value="{DynamicResource TabViewButtonBackgroundDisabled}" />
                            <Setter TargetName="ContentPresenter" Property="TextElement.Foreground" Value="{DynamicResource TabViewButtonForegroundDisabled}" />
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style x:Key="DefaultDragablzItemStyle" TargetType="dragablz:DragablzItem">
        <Setter Property="OverridesDefaultStyle" Value="True" />
        <Setter Property="Canvas.Left" Value="{Binding X, RelativeSource={RelativeSource Self}}" />
        <Setter Property="Canvas.Top" Value="{Binding Y, RelativeSource={RelativeSource Self}}" />
        <Setter Property="HorizontalContentAlignment" Value="Stretch" />
        <Setter Property="VerticalContentAlignment" Value="Stretch" />
        <Setter Property="FocusVisualStyle" Value="{DynamicResource {x:Static SystemParameters.FocusVisualStyleKey}}" />
        <Setter Property="ui:FocusVisualHelper.UseSystemFocusVisuals" Value="{DynamicResource UseSystemFocusVisuals}" />
        <Setter Property="ui:ControlHelper.CornerRadius" Value="{DynamicResource OverlayCornerRadius}" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="dragablz:DragablzItem">
                    <!-- This item will cover the separator on its left side. -->
                    <ui:ThemeShadowChrome
                        x:Name="Shadow"
                        CornerRadius="{Binding ElementName=TabContainer, Path=CornerRadius}"
                        Depth="{DynamicResource TabViewShadowDepth}"
                        IsShadowEnabled="False">
                        <Border
                            x:Name="LayoutRoot"
                            Padding="{TemplateBinding Padding}"
                            SnapsToDevicePixels="True">
                            <Grid>

                                <Border
                                    x:Name="TabSeparator"
                                    HorizontalAlignment="Right"
                                    Width="1"
                                    BorderBrush="{DynamicResource TabViewItemSeparator}"
                                    BorderThickness="1"
                                    Margin="{DynamicResource TabViewItemSeparatorMargin}" />

                                <Border
                                    x:Name="TabContainer"
                                    Grid.Column="1"
                                    Background="{DynamicResource TabViewItemHeaderBackground}"
                                    BorderBrush="{TemplateBinding BorderBrush}"
                                    BorderThickness="{TemplateBinding BorderThickness}"
                                    ui:FocusVisualHelper.IsTemplateFocusTarget="True"
                                    Padding="{DynamicResource TabViewItemHeaderPadding}"
                                    CornerRadius="{TemplateBinding ui:ControlHelper.CornerRadius, Converter={StaticResource TopCornerRadiusFilterConverter}}">
                                    <Grid>

                                        <Grid.ColumnDefinitions>
                                            <ColumnDefinition Width="Auto" />
                                            <ColumnDefinition Width="*" />
                                            <ColumnDefinition Width="Auto" />
                                        </Grid.ColumnDefinitions>

                                        <Viewbox
                                            x:Name="IconBox"
                                            MaxWidth="{DynamicResource TabViewItemHeaderIconSize}"
                                            MaxHeight="{DynamicResource TabViewItemHeaderIconSize}"
                                            Margin="{DynamicResource TabViewItemHeaderIconMargin}">
                                            <ContentControl
                                                x:Name="IconControl"
                                                Content="{TemplateBinding local:DragablzItemHelper.Icon}"
                                                Focusable="False"
                                                Foreground="{DynamicResource TabViewItemIconForeground}" />
                                        </Viewbox>

                                        <ContentPresenter
                                            x:Name="ContentPresenter"
                                            Grid.Column="1"
                                            HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
                                            VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
                                            TextElement.Foreground="{DynamicResource TabViewItemHeaderForeground}"
                                            TextElement.FontWeight="{TemplateBinding FontWeight}"
                                            TextElement.FontSize="{DynamicResource TabViewItemHeaderFontSize}"
                                            Focusable="False"
                                            RecognizesAccessKey="True"
                                            SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />

                                        <Thumb
                                            x:Name="PART_Thumb"
                                            Grid.ColumnSpan="3"
                                            HorizontalAlignment="Stretch"
                                            VerticalContentAlignment="Stretch"
                                            Margin="{Binding Padding, ElementName=TabContainer, Converter={StaticResource InvertThicknessConverter}}"
                                            Style="{StaticResource InvisibleThumbStyle}" />

                                        <Button
                                            x:Name="CloseButton"
                                            Grid.Column="2"
                                            Width="{DynamicResource TabViewItemHeaderCloseButtonSize}"
                                            Height="{DynamicResource TabViewItemHeaderCloseButtonSize}"
                                            FontSize="{DynamicResource TabViewItemHeaderCloseFontSize}"
                                            Margin="{DynamicResource TabViewItemHeaderCloseMargin}"
                                            Content="&#xE711;"
                                            IsTabStop="False"
                                            Background="{DynamicResource TabViewButtonBackground}"
                                            Foreground="{DynamicResource TabViewButtonForeground}"
                                            Style="{StaticResource TabViewCloseButtonStyle}"
                                            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>
                                </Border>
                            </Grid>
                        </Border>
                    </ui:ThemeShadowChrome>

                    <ControlTemplate.Triggers>
                        <!-- PointerOver -->
                        <Trigger Property="IsMouseOver" Value="True">
                            <Setter TargetName="TabContainer" Property="Background" Value="{DynamicResource TabViewItemHeaderBackgroundPointerOver}" />
                            <Setter TargetName="ContentPresenter" Property="TextElement.Foreground" Value="{DynamicResource TabViewItemHeaderForegroundPointerOver}" />
                            <Setter TargetName="IconControl" Property="Foreground" Value="{DynamicResource TabViewItemIconForegroundPointerOver}" />
                        </Trigger>
                        <!-- Selected -->
                        <Trigger Property="IsSelected" Value="True">
                            <Setter TargetName="Shadow" Property="IsShadowEnabled" Value="{DynamicResource {x:Static SystemParameters.DropShadowKey}}" />
                            <Setter TargetName="TabContainer" Property="Background" Value="{DynamicResource TabViewItemHeaderBackgroundSelected}" />
                            <Setter TargetName="ContentPresenter" Property="TextElement.Foreground" Value="{DynamicResource TabViewItemHeaderForegroundSelected}" />
                            <Setter TargetName="IconControl" Property="Foreground" Value="{DynamicResource TabViewItemIconForegroundSelected}" />
                            <Setter Property="Panel.ZIndex" Value="1" />
                        </Trigger>
                        <!-- PointerOverSelected -->
                        <MultiTrigger>
                            <MultiTrigger.Conditions>
                                <Condition Property="IsMouseOver" Value="True" />
                                <Condition Property="IsSelected" Value="True" />
                            </MultiTrigger.Conditions>
                            <Setter TargetName="TabContainer" Property="Background" Value="{DynamicResource TabViewItemHeaderBackgroundSelected}" />
                            <Setter TargetName="ContentPresenter" Property="TextElement.Foreground" Value="{DynamicResource TabViewItemHeaderForegroundPointerOver}" />
                            <Setter TargetName="IconControl" Property="Foreground" Value="{DynamicResource TabViewItemIconForegroundPointerOver}" />
                            <Setter Property="Panel.ZIndex" Value="1" />
                        </MultiTrigger>
                        <!-- Disabled -->
                        <Trigger Property="IsEnabled" Value="False">
                            <Setter TargetName="IconControl" Property="Foreground" Value="{DynamicResource TabViewButtonForegroundDisabled}" />
                            <Setter TargetName="ContentPresenter" Property="TextElement.Foreground" Value="{DynamicResource TabViewItemHeaderForegroundDisabled}" />
                        </Trigger>
                        <!-- NoIcon -->
                        <Trigger SourceName="IconControl" Property="Content" Value="{x:Null}">
                            <Setter TargetName="IconBox" Property="Visibility" Value="Collapsed" />
                        </Trigger>
                        <Trigger Property="dragablz:TabablzControl.IsWrappingTabItem" Value="True">
                            <Setter TargetName="ContentPresenter" Property="Content" Value="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=DataContext.Header}" />
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style x:Key="TabScrollViewerStyle" TargetType="ScrollViewer" BasedOn="{StaticResource DefaultScrollViewerStyle}">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="ScrollViewer">
                    <Border
                        x:Name="Root"
                        Background="{TemplateBinding Background}"
                        BorderBrush="{TemplateBinding BorderBrush}"
                        BorderThickness="{TemplateBinding BorderThickness}">

                        <Grid>
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="Auto" />
                                <ColumnDefinition Width="*" />
                                <ColumnDefinition Width="Auto" />
                            </Grid.ColumnDefinitions>

                            <RepeatButton
                                x:Name="ScrollDecreaseButton"
                                VerticalAlignment="Bottom"
                                Width="{DynamicResource TabViewItemScrollButtonWidth}"
                                Height="{DynamicResource TabViewItemScrollButtonHeight}"
                                Padding="{DynamicResource TabViewItemScrollButtonPadding}"
                                Background="{DynamicResource TabViewScrollButtonBackground}"
                                BorderThickness="1"
                                Delay="50"
                                FontFamily="{DynamicResource SymbolThemeFontFamily}"
                                Interval="100"
                                Visibility="{TemplateBinding ComputedHorizontalScrollBarVisibility}"
                                Content="&#xE76B;" />

                            <ScrollContentPresenter
                                x:Name="PART_ScrollContentPresenter"
                                Grid.Column="1" />

                            <RepeatButton
                                x:Name="ScrollIncreaseButton"
                                Grid.Column="2"
                                VerticalAlignment="Bottom"
                                HorizontalAlignment="Center"
                                Width="{DynamicResource TabViewItemScrollButtonWidth}"
                                Height="{DynamicResource TabViewItemScrollButtonHeight}"
                                Padding="{DynamicResource TabViewItemScrollButtonPadding}"
                                Background="{DynamicResource TabViewScrollButtonBackground}"
                                BorderThickness="1"
                                Delay="50"
                                FontFamily="{DynamicResource SymbolThemeFontFamily}"
                                Interval="100"
                                Visibility="{TemplateBinding ComputedHorizontalScrollBarVisibility}"
                                Content="&#xE76C;" />
                        </Grid>
                    </Border>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style TargetType="local:DragablzItemsControlEx">
        <Setter Property="HorizontalAlignment" Value="Left" />
        <Setter Property="VerticalAlignment" Value="Top" />
        <Setter Property="Padding" Value="{DynamicResource TabViewTopHeaderPadding}" />
        <Setter Property="Focusable" Value="False" />
        <Setter Property="KeyboardNavigation.TabNavigation" Value="Once" />
        <Setter Property="ScrollViewer.HorizontalScrollBarVisibility" Value="Auto" />
        <Setter Property="ScrollViewer.VerticalScrollBarVisibility" Value="Disabled" />
        <Setter Property="ScrollViewer.IsDeferredScrollingEnabled" Value="False" />
        <Setter Property="ItemsPanel">
            <Setter.Value>
                <ItemsPanelTemplate>
                    <Canvas IsItemsHost="True" />
                </ItemsPanelTemplate>
            </Setter.Value>
        </Setter>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="local:DragablzItemsControlEx">
                    <Border
                        BorderBrush="{TemplateBinding BorderBrush}"
                        Background="{TemplateBinding Background}"
                        BorderThickness="{TemplateBinding BorderThickness}"
                        CornerRadius="{TemplateBinding ui:ControlHelper.CornerRadius}"
                        SnapsToDevicePixels="True">
                        <ScrollViewer
                            x:Name="ScrollViewer"
                            HorizontalScrollBarVisibility="{TemplateBinding ScrollViewer.HorizontalScrollBarVisibility}"
                            IsDeferredScrollingEnabled="{TemplateBinding ScrollViewer.IsDeferredScrollingEnabled}"
                            VerticalScrollBarVisibility="{TemplateBinding ScrollViewer.VerticalScrollBarVisibility}"
                            Style="{StaticResource TabScrollViewerStyle}">
                            <ItemsPresenter
                                x:Name="TabsItemsPresenter"
                                SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"
                                HorizontalAlignment="Left"
                                VerticalAlignment="Top"
                                Width="{TemplateBinding ItemsPresenterWidth}"
                                Height="{TemplateBinding ItemsPresenterHeight}"
                                Margin="{TemplateBinding Padding}" />
                        </ScrollViewer>
                    </Border>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style TargetType="local:TabablzControlEx">
        <Setter Property="Focusable" Value="False" />
        <Setter Property="Background" Value="{DynamicResource TabViewBackground}" />
        <Setter Property="ItemContainerStyle" Value="{StaticResource DefaultDragablzItemStyle}" />
        <Setter Property="AdjacentHeaderItemOffset" Value="-1" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="local:TabablzControlEx">
                    <Grid
                        x:Name="templateRoot"
                        ClipToBounds="true"
                        SnapsToDevicePixels="true"
                        KeyboardNavigation.TabNavigation="Local">
                        <Grid.RowDefinitions>
                            <RowDefinition Height="Auto" />
                            <RowDefinition Height="*" />
                        </Grid.RowDefinitions>
                        <Border
                            x:Name="contentPanel"
                            Grid.Row="1"
                            BorderBrush="{TemplateBinding BorderBrush}"
                            BorderThickness="{TemplateBinding BorderThickness}"
                            KeyboardNavigation.DirectionalNavigation="Contained"
                            KeyboardNavigation.TabIndex="3"
                            KeyboardNavigation.TabNavigation="Local">
                            <Grid x:Name="PART_ItemsHolder" />
                        </Border>
                        <Grid
                            x:Name="TabContainerGrid"
                            Background="{TemplateBinding Background}"
                            Visibility="{TemplateBinding IsHeaderPanelVisible, Converter={StaticResource BooleanToVisibilityConverter}}">

                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="Auto" x:Name="LeftContentColumn" />
                                <ColumnDefinition Width="Auto" x:Name="TabColumn" />
                                <ColumnDefinition Width="Auto" x:Name="AddButtonColumn" />
                                <ColumnDefinition Width="*" x:Name="RightContentColumn" />
                            </Grid.ColumnDefinitions>

                            <ContentPresenter
                                Grid.Column="0"
                                x:Name="LeftContentPresenter"
                                ContentSource="HeaderPrefixContent" />

                            <local:DragablzItemsControlEx
                                x:Name="PART_HeaderItemsControl"
                                Grid.Column="1"
                                ItemsSource="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=Items}"
                                ItemContainerStyle="{TemplateBinding ItemContainerStyle}"
                                ItemsOrganiser="{TemplateBinding HeaderItemsOrganiser}"
                                KeyboardNavigation.TabIndex="1"
                                Panel.ZIndex="1"
                                ItemTemplate="{TemplateBinding HeaderItemTemplate}"
                                FixedItemCount="{TemplateBinding FixedHeaderCount}" />

                            <Button
                                x:Name="AddButton"
                                Grid.Column="2"
                                Content="&#xE710;"
                                VerticalAlignment="Stretch"
                                Command="{x:Static dragablz:TabablzControl.AddItemCommand}"
                                Visibility="{TemplateBinding ShowDefaultAddButton, Converter={StaticResource BooleanToVisibilityConverter}}"
                                Style="{StaticResource TabViewButtonStyle}"
                                KeyboardNavigation.TabIndex="2" />

                            <ContentPresenter
                                Grid.Column="3"
                                x:Name="RightContentPresenter"
                                HorizontalAlignment="Stretch"
                                ContentSource="HeaderSuffixContent" />
                        </Grid>
                    </Grid>
                    <ControlTemplate.Triggers>
                        <Trigger Property="IsDraggingWindow" Value="True">
                            <Setter TargetName="AddButton" Property="Visibility" Value="Collapsed" />
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

</ResourceDictionary>