<UserControl x:Class="Filtration.ItemFilterPreview.UserControls.ItemControl"
             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:designTime="clr-namespace:Filtration.ItemFilterPreview.UserControls.DesignTime"
             xmlns:converters="clr-namespace:Filtration.Common.Converters;assembly=Filtration.Common"
             mc:Ignorable="d" 
             d:DataContext="{d:DesignInstance Type=designTime:DesignTimeItemControl, IsDesignTimeCreatable=True}"
             d:DesignHeight="35" d:DesignWidth="170">
    <UserControl.Resources>
        <Style x:Key="PathOfExileFont" TargetType="{x:Type TextBlock}">
            <Setter Property="FontFamily" Value="pack://application:,,,/resources/#Fontin SmallCaps" />
        </Style>
        <converters:ColorToSolidColorBrushConverter x:Key="ColorToSolidColorBrushConverter"/>
    </UserControl.Resources>
        <Grid>
            <Grid.RowDefinitions>
                <RowDefinition Height="*" />
                <RowDefinition Height="Auto" />
                <RowDefinition Height="*" />
            </Grid.RowDefinitions>
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="*" />
                <ColumnDefinition Width="Auto" />
                <ColumnDefinition Width="*" />
            </Grid.ColumnDefinitions>
            <Border Grid.Row="1" Grid.Column="1" Margin="3" Padding="4,0,4,0" BorderThickness="1" BorderBrush="{Binding FilteredItem.BorderColor, Converter={StaticResource ColorToSolidColorBrushConverter}}">
                <Border.Background>
                    <SolidColorBrush Color="{Binding FilteredItem.BackgroundColor}" />
                </Border.Background>
                <TextBlock HorizontalAlignment="Center" VerticalAlignment="Center" Text="{Binding FilteredItem.Item.Description}" Style="{StaticResource PathOfExileFont}" FontSize="{Binding FilteredItem.FontSize}">
                    <TextBlock.Foreground>
                        <SolidColorBrush Color="{Binding FilteredItem.TextColor}" />
                    </TextBlock.Foreground>
                </TextBlock>
            </Border>
        </Grid>
</UserControl>
