<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:ghfvs="https://github.com/github/VisualStudio"
                    xmlns:uirx="clr-namespace:GitHub.UI">

    <Style x:Key="ErrorMessageStyle" TargetType="{x:Type uirx:ErrorMessageDisplay}">
        <Setter Property="IconFill" Value="{DynamicResource GitHubErrorBrush}" />
        <Setter Property="KeyboardNavigation.IsTabStop" Value="False" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type uirx:ErrorMessageDisplay}">
                    <Grid HorizontalAlignment="Center">
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="Auto" />
                            <ColumnDefinition Width="*"/>
                        </Grid.ColumnDefinitions>
                        <Viewbox
                            Grid.Column="0"
                            VerticalAlignment="Top" 
                            HorizontalAlignment="Right"
                            Margin="{TemplateBinding IconMargin}"
                            Width="16"
                            Height="16">
                            <ghfvs:OcticonPath
                                x:Name="icon"
                                Icon="{TemplateBinding Icon}"
                                Height="16"
                                Fill="{TemplateBinding IconFill}" />
                        </Viewbox>
                        <ContentPresenter
                            TextElement.FontFamily="{TemplateBinding FontFamily}"
                            Grid.Column="1"
                            HorizontalAlignment="Left"
                            VerticalAlignment="Center"
                            SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"
                            ToolTip="{TemplateBinding Message}"
                            Content="{TemplateBinding Content}" />
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style TargetType="{x:Type uirx:ErrorMessageDisplay}" BasedOn="{StaticResource ErrorMessageStyle}" />

    <Style TargetType="ToolTip">
        <Setter Property="Visibility" Value="Visible" />
        <Style.Triggers>
            <DataTrigger Binding="{Binding RelativeSource={RelativeSource Self}, Path=Content}" Value="{x:Null}">
                <Setter Property="Visibility" Value="Collapsed" />
            </DataTrigger>
            <DataTrigger Binding="{Binding RelativeSource={RelativeSource Self}, Path=Content}" Value="">
                <Setter Property="Visibility" Value="Collapsed" />
            </DataTrigger>
        </Style.Triggers>
    </Style>

</ResourceDictionary>