<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
    <ResourceDictionary.MergedDictionaries>
        <ResourceDictionary Source="../Brushes/Icons.xaml"/>
        <ResourceDictionary Source="../BaseControlStyles/ButtonStyle.xaml"/>
        <ResourceDictionary Source="../Icons/PlayArrowIconStyle.xaml"/>
    </ResourceDictionary.MergedDictionaries>

    <Style x:Key="ButtonContextMenuFocusVisual">
        <Setter Property="Control.Template">
            <Setter.Value>
                <ControlTemplate>
                    <Border>
                        <Rectangle SnapsToDevicePixels="true" Stroke="White" StrokeThickness="1" />
                    </Border>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style TargetType="{x:Type Button}" x:Key="ButtonContextMenu">
        <Setter Property="Cursor" Value="Hand" />
        <Setter Property="OverridesDefaultStyle" Value="True"/>
        <Setter Property="FontFamily" Value="Arial"/>
        <Setter Property="FontSize" Value="14"/>
        <Setter Property="FontWeight" Value="Normal"/>
        <Setter Property="FocusVisualStyle" Value="{StaticResource ButtonContextMenuFocusVisual}" />
        <Setter Property="Height" Value="30" />        
        <Setter Property="Background" Value="Transparent" />
        <Setter Property="Foreground" Value="White"/>
        <Setter Property="SnapsToDevicePixels" Value="True"></Setter>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type Button}">
                    <Border 
                        x:Name="border" 
                        BorderBrush="Transparent"
                        BorderThickness="1"
                        Background="{TemplateBinding Background}">
                        <Grid>
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="50"/>
                                <ColumnDefinition Width="*"/>
                            </Grid.ColumnDefinitions>
                            <TextBlock Grid.Column="0" x:Name="selectionIndicator"
                                       Style="{StaticResource PlayArrowIcon}"
                                       Visibility="Hidden" 
                                       HorizontalAlignment="Center"
                                       VerticalAlignment="Center"/>
                            <ContentPresenter Grid.Column="1" HorizontalAlignment="Left" VerticalAlignment="Center" x:Name="content" />
                        </Grid>
                    </Border>
                    <ControlTemplate.Triggers>
                        <Trigger Property="IsKeyboardFocused" Value="True">
                            <Setter Property="Background">
                                <Setter.Value>
                                    <SolidColorBrush Color="White" />
                                </Setter.Value>
                            </Setter>
                            <Setter Property="Foreground" Value="{StaticResource ActiveElementBackgroundBrush}"/>
                            <Setter TargetName="selectionIndicator" Property="Visibility" Value="Visible"/>
                            <Setter TargetName="border" Property="BorderBrush" Value="White"/>
                        </Trigger>
                        <Trigger Property="IsMouseOver" Value="True">                            
                            <Setter Property="FocusManager.FocusedElement" 
                                    Value="{Binding RelativeSource={RelativeSource Self}}" />
                        </Trigger>
                        <Trigger Property="IsPressed" Value="True">
                            <Setter Property="Background">
                                <Setter.Value>
                                    <SolidColorBrush Color="White" />
                                </Setter.Value>
                            </Setter>
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    
</ResourceDictionary>
                    
