<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:bpa="clr-namespace:BPA.UIControl">

    <ResourceDictionary.MergedDictionaries>
        <ResourceDictionary Source="pack://application:,,,/BPA.UIControl;component/Themes/Resources/Default.xaml" />
    </ResourceDictionary.MergedDictionaries>

    <Style x:Key="RubyerTag" TargetType="{x:Type bpa:Tag}">
        <Setter Property="Background" Value="{DynamicResource Primary}" />
        <Setter Property="BorderBrush" Value="Transparent" />
        <Setter Property="BorderThickness" Value="0" />
        <Setter Property="Cursor" Value="Hand" />
        <Setter Property="Foreground" Value="{DynamicResource WhiteForeground}" />
        <Setter Property="HeadBackground" Value="{DynamicResource DefaultForeground}" />
        <Setter Property="HeadForeground" Value="{DynamicResource DefaultBackground}" />
        <Setter Property="SnapsToDevicePixels" Value="True" />
        <Setter Property="Padding" Value="5 3" />
        <Setter Property="FocusVisualStyle" Value="{StaticResource FocusVisual}" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type bpa:Tag}">
                    <Border x:Name="rootBorder"
                            CornerRadius="3"
                            ToolTip="{TemplateBinding Url}">
                        <Grid>
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="Auto" />
                                <ColumnDefinition Width="Auto" />
                            </Grid.ColumnDefinitions>
                            <Border x:Name="headBorder"
                                    Padding="{TemplateBinding Padding}"
                                    Background="{TemplateBinding HeadBackground}"
                                    CornerRadius="{DynamicResource LeftControlCornerRadius}"
                                    TextBlock.FontWeight="Bold"
                                    TextBlock.Foreground="{TemplateBinding HeadForeground}">
                                <ContentPresenter ContentSource="Header"
                                                  Focusable="False"
                                                  RecognizesAccessKey="True"
                                                  SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
                            </Border>
                            <Border x:Name="contentBorder"
                                    Grid.Column="1"
                                    Padding="{TemplateBinding Padding}"
                                    Background="{TemplateBinding Background}"
                                    CornerRadius="{DynamicResource RightControlCornerRadius}"
                                    TextBlock.FontWeight="Bold"
                                    TextBlock.Foreground="{TemplateBinding Foreground}">
                                <ContentPresenter Focusable="False"
                                                  RecognizesAccessKey="True"
                                                  SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
                            </Border>
                        </Grid>
                    </Border>
                    <ControlTemplate.Triggers>
                        <Trigger Property="Url" Value="{x:Null}">
                            <Setter Property="Cursor" Value="Arrow" />
                        </Trigger>
                        <Trigger Property="Header" Value="{x:Null}">
                            <Setter TargetName="contentBorder" Property="CornerRadius" Value="3" />
                            <Setter TargetName="headBorder" Property="Padding" Value="0" />
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
</ResourceDictionary>