<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
                    xmlns:local="clr-namespace:MaxLauncher;assembly=MaxLauncher">

    <!-- *********************************************************************************** -->
    <!-- FavoritesButtonStyle -->
    <Style TargetType="{x:Type local:FavoritesButton}">
        <Setter Property="FocusVisualStyle" Value="{x:Null}" />
        <Setter Property="BorderThickness" Value="1"/>
        <Setter Property="Margin" Value="3" />
        <Setter Property="BorderBrush" Value="{DynamicResource FavoritesButton.BorderBrush}"/>
        <Setter Property="Background" Value="{DynamicResource FavoritesButton.Background}"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type local:MButton}">
                    <Border x:Name="BD"
                            BorderBrush="{TemplateBinding BorderBrush}" 
                            BorderThickness="{TemplateBinding BorderThickness}"
                            Margin="{TemplateBinding Margin}"
                            Background="{TemplateBinding Background}"
                            SnapsToDevicePixels="True"
                            CornerRadius="4">
                        <Grid>
                            <Grid.RowDefinitions>
                                <RowDefinition Height="Auto"/>
                                <RowDefinition Height="*"/>
                            </Grid.RowDefinitions>
                            <Image Grid.Row="0" 
                                   Source="{TemplateBinding Image}" 
                                   Stretch="None"
                                   Margin="5">
                            </Image>
                            <TextBlock x:Name="ButtonText" Grid.Row="1" 
                                       Text="{TemplateBinding Text}" 
                                       TextWrapping="Wrap" 
                                       TextAlignment="Center" 
                                       TextTrimming="CharacterEllipsis"
                                       Foreground="{DynamicResource FavoritesButton.Text.Foreground}"
									   ToolTip="{TemplateBinding Text}"
                                       Margin="5,0,5,5">
                            </TextBlock>
                            <TextBlock Text="{TemplateBinding Key}"
                                   HorizontalAlignment="Left" 
                                   Margin="3,2,0,0" 
                                   Foreground="{DynamicResource FavoritesButton.Key.Foreground}" 
                                   Padding="0" >
                            </TextBlock>
                        </Grid>
                    </Border>
                    <ControlTemplate.Triggers>
                        <Trigger Property="IsMouseOver" Value="True">
                            <Setter Property="Background" TargetName="BD" Value="{DynamicResource FavoritesButton.MouseOver.Background}" />
                        </Trigger>
                        <Trigger Property="IsFocused" Value="True">
                            <Setter Property="BorderBrush" Value="{DynamicResource FavoritesButton.Focused.BorderBrush}" />
                            <Setter Property="BorderThickness" Value="2" />
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
</ResourceDictionary>
