<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="{DynamicResource FavoritesButton.Border.Thickness}"/>
        <Setter Property="Margin" Value="{DynamicResource FavoritesButton.Margin}" />
        <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="{DynamicResource FavoritesButton.CornerRadius}">
                        <Grid>
                            <Grid.RowDefinitions>
                                <RowDefinition Height="*"/>
                                <RowDefinition Height="*"/>
                            </Grid.RowDefinitions>
                            <Image Grid.Row="0" 
                                   Source="{TemplateBinding Image}" 
                                   Stretch="Uniform"
                                   Margin="5">
                            </Image>
                            <TextBlock x:Name="ButtonText" Grid.Row="1" 
                                       Text="{TemplateBinding Text}" 
                                       TextWrapping="Wrap" 
                                       TextAlignment="Center" 
                                       TextTrimming="CharacterEllipsis"
                                       Foreground="{DynamicResource FavoritesButton.Text.Foreground}"
                                       FontSize="{DynamicResource FavoritesButton.Text.FontSize}"
                                       FontFamily="{DynamicResource FavoritesButton.Text.FontFamily}"
									                     ToolTip="{TemplateBinding Text}"
                                       Margin="5,0,5,5">
                            </TextBlock>
                            <TextBlock x:Name="KeyText" Text="{TemplateBinding Key}"
                                   HorizontalAlignment="Left" 
                                   Margin="3,2,0,0" 
                                   Foreground="{DynamicResource FavoritesButton.Key.Foreground}" 
                                   FontSize="{DynamicResource FavoritesButton.Key.FontSize}"
                                   FontFamily="{DynamicResource FavoritesButton.Key.FontFamily}"
                                   Padding="0" >
                            </TextBlock>
                        </Grid>
                    </Border>
                    <ControlTemplate.Triggers>
                        <Trigger Property="IsMouseOver" Value="True">
                            <Setter Property="Background" TargetName="BD" Value="{DynamicResource FavoritesButton.MouseOver.Background}" />
                            <Setter Property="Foreground" TargetName="KeyText" Value="{DynamicResource FavoritesButton.MouseOver.Foreground}" />
                            <Setter Property="Foreground" TargetName="ButtonText" Value="{DynamicResource FavoritesButton.MouseOver.Foreground}" />
                        </Trigger>
                        <Trigger Property="IsFocused" Value="True">
                            <Setter Property="BorderBrush" Value="{DynamicResource FavoritesButton.Focused.BorderBrush}" />
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
</ResourceDictionary>
