<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:PresentationOptions="http://schemas.microsoft.com/winfx/2006/xaml/presentation/options"
                    xmlns:ui="clr-namespace:GitHub.UI;assembly=GitHub.UI">
  <PathGeometry x:Key="arrow" Figures="M 0,448 224,768 448,448" />

  <Style TargetType="{x:Type ui:GitHubActionLink}">
    <Setter Property="Background" Value="Transparent" />
    <Setter Property="Focusable" Value="True" />
    <Setter Property="Foreground" Value="{DynamicResource GitHubActionLinkItemBrush}" />
    <Setter Property="TextTrimming" Value="None" />
    <Setter Property="Template">
      <Setter.Value>
        <ControlTemplate TargetType="{x:Type ui:GitHubActionLink}">
          <TextBlock TextTrimming="{TemplateBinding TextTrimming}" TextWrapping="{TemplateBinding TextWrapping}">
            <TextBlock.Style>
              <Style TargetType="TextBlock">
                <Style.Triggers>
                  <Trigger Property="IsEnabled" Value="False">
                    <Setter Property="Opacity" Value="0.5"/>
                  </Trigger>
                </Style.Triggers>
              </Style>
            </TextBlock.Style>
            <Hyperlink Command="{TemplateBinding Command}"
                       CommandParameter="{TemplateBinding CommandParameter}"
                       Foreground="{TemplateBinding Foreground}">
              <Hyperlink.Resources>
                <Style TargetType="{x:Type Hyperlink}">
                  <Style.Triggers>
                    <MultiTrigger>
                      <MultiTrigger.Conditions>
                        <Condition Property="UIElement.IsMouseOver" Value="false" />
                        <Condition Property="IsEnabled" Value="true" />
                      </MultiTrigger.Conditions>
                      <MultiTrigger.Setters>
                        <Setter Property="TextDecorations" Value="None" />
                        <Setter Property="FrameworkElement.Cursor" Value="None" />
                      </MultiTrigger.Setters>
                    </MultiTrigger>
                    <MultiTrigger>
                      <MultiTrigger.Conditions>
                        <Condition Property="IsMouseOver" Value="true" />
                        <Condition Property="IsEnabled" Value="true" />
                      </MultiTrigger.Conditions>
                      <MultiTrigger.Setters>
                        <Setter Property="TextDecorations" Value="Underline" />
                        <Setter Property="FrameworkElement.Cursor" Value="Hand" />
                      </MultiTrigger.Setters>
                    </MultiTrigger>
                    <Trigger Property="IsEnabled" Value="False">
                      <Setter Property="TextDecorations" Value="None" />
                    </Trigger>
                  </Style.Triggers>
                </Style>
              </Hyperlink.Resources>
              <Run Text="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=Content}" />
              <Polygon Margin="2,0,0,1"
                       Fill="{TemplateBinding Foreground}"
                       Points="0,0 8,0 4,4 0,0"
                       Visibility="{Binding RelativeSource={RelativeSource TemplatedParent},
                                            Path=HasDropDown,
                                            Converter={ui:BooleanToVisibilityConverter}}" />

            </Hyperlink>
          </TextBlock>
        </ControlTemplate>
      </Setter.Value>
    </Setter>
  </Style>
</ResourceDictionary>