<UserControl x:Class="Hearthstone_Deck_Tracker.Controls.DeckPicker.DeckPickerItemLayouts.DeckPickerItemLayout1"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
             xmlns:utility="clr-namespace:Hearthstone_Deck_Tracker.Utility"
             xmlns:deckPicker="clr-namespace:Hearthstone_Deck_Tracker.Controls.DeckPicker"
             xmlns:hearthstoneDeckTracker="clr-namespace:Hearthstone_Deck_Tracker"
             xmlns:lex="http://wpflocalizeextension.codeplex.com"
             lex:LocalizeDictionary.DesignCulture="en"
             lex:ResxLocalizationProvider.DefaultAssembly="HearthstoneDeckTracker"
             lex:ResxLocalizationProvider.DefaultDictionary="Strings"
             mc:Ignorable="d"
             d:DesignHeight="300" d:DesignWidth="300" Height="52">
    <Border BorderBrush="{DynamicResource MenuItemDisabledBrush}" BorderThickness="0,0,0,1">
        <DockPanel>
            <Grid Width="46" Height="46" Margin="5,1,10,0">
                <Image DockPanel.Dock="Left" Width="46" Height="46" Source="{Binding ClassImage}" RenderOptions.BitmapScalingMode="Fant" />
                <Rectangle Width="18" Height="14" Visibility="{Binding WildIndicatorVisibility}" Margin="0,2,0,0" HorizontalAlignment="Right" VerticalAlignment="Top"
                           ToolTip="{Binding WildIndicatorTooltip, RelativeSource={RelativeSource AncestorType=deckPicker:DeckPickerItem}}">
                    <Rectangle.Fill>
                        <VisualBrush Visual="{StaticResource wild_icon}" />
                    </Rectangle.Fill>
                </Rectangle>
            </Grid>
            <Grid DockPanel.Dock="Right" MinWidth="65">
                <Grid.RowDefinitions>
                    <RowDefinition Height="*"></RowDefinition>
                    <RowDefinition Height="Auto"></RowDefinition>
                </Grid.RowDefinitions>
                <Grid.Resources>
                    <deckPicker:DateConverter x:Key="DateConverter"></deckPicker:DateConverter>
                </Grid.Resources>
                <Border  PreviewMouseDown="UseButton_OnPreviewMouseDown" Background="#01000000"
                    Visibility="{Binding Source={ x:Static utility:ConfigWrapper.UseButtonVisiblity}}">
                    <Border.Style>
                        <Style>
                            <Style.Triggers>
                                <Trigger Property="Border.IsMouseOver" Value="True">
                                    <Setter Property="TextBlock.FontWeight" Value="Bold" />
                                </Trigger>
                            </Style.Triggers>
                        </Style>
                    </Border.Style>
                    <TextBlock
                    Text="{Binding TextUseButton, RelativeSource={RelativeSource AncestorType=deckPicker:DeckPickerItem}}"
                    FontSize="13" HorizontalAlignment="Right" VerticalAlignment="Center" Margin="5,0,10,0"
                    Foreground="{DynamicResource GrayTextColorBrush}" />
                </Border>
                <TextBlock Grid.Row="1" Text="{Binding DateShownOnDeck, RelativeSource={RelativeSource AncestorType=deckPicker:DeckPickerItem}, Converter={StaticResource DateConverter}}" HorizontalAlignment="Right"
                           Foreground="{DynamicResource GrayTextColorBrush}" FontSize="11" Margin="0, 0, 10, 3"
                           Visibility="{Binding Source={x:Static utility:ConfigWrapper.ShowDateOnDeckVisibility}}"
                               ToolTip="{Binding DateShownOnDeckTooltip, RelativeSource={RelativeSource AncestorType=deckPicker:DeckPickerItem}}" />
            </Grid>
            
            <StackPanel Margin="0,5">
                <DockPanel>
                    <Image DockPanel.Dock="Left" Source="{x:Static utility:ImageCache.Archived}" Width="16"
                           Height="16" Margin="0,0,5,0" VerticalAlignment="Center" HorizontalAlignment="Left"
                           Visibility="{Binding ArchivedVisibility}"
                           ToolTip="{Binding ArchivedTooltip, RelativeSource={RelativeSource AncestorType=deckPicker:DeckPickerItem}}" />
                    <DockPanel>
                        <Image Source="{DynamicResource HsReplayIcon}" 
                               Visibility="{Binding HsReplayDataIndicatorVisibility, RelativeSource={RelativeSource AncestorType=deckPicker:DeckPickerItem}}"
                               ToolTip="{Binding DataIndicatorTooltip, RelativeSource={RelativeSource AncestorType=deckPicker:DeckPickerItem}}"
                               Width="14" RenderOptions.BitmapScalingMode="Fant"
                               DockPanel.Dock="Left" Margin="0,0,4,0"/>
                        <TextBlock Text="{Binding NameAndVersion}" Margin="0,0,15,0" DockPanel.Dock="Left"
                                   FontSize="17" TextTrimming="CharacterEllipsis"
                                   Foreground="{DynamicResource TextBrush}"
                                   FontWeight="{Binding FontWeightActiveDeck, RelativeSource={RelativeSource AncestorType=deckPicker:DeckPickerItem}}" />
                        <Rectangle Width="10" Height="13" Visibility="{Binding NoteVisibility}" Margin="-10,0,0,0"
                                   ToolTip="{Binding Note}">
                            <Rectangle.Fill>
                                <VisualBrush Visual="{StaticResource appbar_page_bold}" />
                            </Rectangle.Fill>
                        </Rectangle>
                        <Grid DockPanel.Dock="Right" />
                    </DockPanel>
                </DockPanel>
                <DockPanel Margin="0,-2,0,0" Height="19">
                    <Viewbox DockPanel.Dock="Left" MinWidth="70" StretchDirection="DownOnly" Stretch="Fill"
                             HorizontalAlignment="Left">
                        <TextBlock Text="{Binding StatsString, RelativeSource={RelativeSource AncestorType=deckPicker:DeckPickerItem}}" HorizontalAlignment="Left"
                                   Foreground="{DynamicResource GrayTextColorBrush}" FontSize="14" />
                    </Viewbox>
                    <Viewbox Margin="10,0,0,0" StretchDirection="DownOnly" Stretch="Fill" DockPanel.Dock="Left">
                        <ItemsControl ItemsSource="{Binding Tags}">
                            <ItemsControl.ItemsPanel>
                                <ItemsPanelTemplate>
                                    <DockPanel />
                                </ItemsPanelTemplate>
                            </ItemsControl.ItemsPanel>
                            <ItemsControl.ItemTemplate>
                                <DataTemplate>
                                    <Border DockPanel.Dock="Right" BorderBrush="{DynamicResource GrayTextColorBrush}"
                                            BorderThickness="1" Margin="2,0,0,0">
                                        <TextBlock Text="{Binding}" FontSize="10"
                                                   Foreground="{DynamicResource GrayTextColorBrush}" VerticalAlignment="Center"
                                                   TextAlignment="Center" TextTrimming="CharacterEllipsis" Margin="4,0" />
                                    </Border>
                                </DataTemplate>
                            </ItemsControl.ItemTemplate>
                        </ItemsControl>
                    </Viewbox>
                    <Grid />
                </DockPanel>
            </StackPanel>
        </DockPanel>
    </Border>
</UserControl>
