<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:Fluent="clr-namespace:Fluent">
    <Style x:Key="RibbonTitleBarStyle"
           TargetType="{x:Type Fluent:RibbonTitleBar}">
        <Setter Property="Template"
                Value="{DynamicResource RibbonTitleBarControlTemplate}" />
        <Setter Property="Focusable"
                Value="False" />
        <Setter Property="VerticalAlignment"
                Value="Top" />
        <Setter Property="HorizontalAlignment"
                Value="Stretch" />
        <Setter Property="HeaderTemplate">
            <Setter.Value>
                <DataTemplate>
                    <TextBlock VerticalAlignment="Center"
                               HorizontalAlignment="Center"
                               Text="{Binding}"
                               TextWrapping="NoWrap"
                               TextTrimming="CharacterEllipsis" />
                </DataTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <ControlTemplate x:Key="RibbonTitleBarControlTemplate"
                     TargetType="{x:Type Fluent:RibbonTitleBar}">
        <Grid>
            <ContentPresenter x:Name="PART_QuickAccessToolbarHolder"
                              ContentSource="QuickAccessToolBar" />
            
            <ContentPresenter x:Name="PART_HeaderHolder"
                              ContentSource="Header"
                              ContentStringFormat="{TemplateBinding HeaderStringFormat}"
                              ContentTemplate="{TemplateBinding HeaderTemplate}"
                              ContentTemplateSelector="{TemplateBinding HeaderTemplateSelector}"                              
                              IsHitTestVisible="False" />
            
            <Fluent:RibbonContextualGroupsContainer x:Name="PART_ItemsContainer"                                                    
                                                    IsItemsHost="True" />
        </Grid>
        <ControlTemplate.Triggers>
            <Trigger Property="IsCollapsed"
                     Value="True">
                <Setter Property="Visibility"
                        Value="Collapsed"
                        TargetName="PART_QuickAccessToolbarHolder" />
                <Setter Property="Visibility"
                        Value="Collapsed"
                        TargetName="PART_ItemsContainer" />
            </Trigger>
            <Trigger Property="HideContextTabs"
                     Value="True">
                <Setter Property="Visibility"
                        Value="Hidden"
                        TargetName="PART_ItemsContainer" />
                <Setter Property="Visibility"
                        Value="Hidden"
                        TargetName="PART_QuickAccessToolbarHolder" />
            </Trigger>
        </ControlTemplate.Triggers>
    </ControlTemplate>
</ResourceDictionary>