<UserControl x:Class="DataViewDashboard.Views.ProductTile"
             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" 
             mc:Ignorable="d" >
    <Grid>
        <Grid.Resources>
            <Style TargetType="TextBlock">
                <Setter Property="Margin" Value="2" />
            </Style>
        </Grid.Resources>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="Auto"/>
            <RowDefinition />
        </Grid.RowDefinitions>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="Auto"/>
            <ColumnDefinition />
            <ColumnDefinition />
        </Grid.ColumnDefinitions>
        <!--<TextBlock Text="{Binding Name}" Grid.ColumnSpan="4" FontSize="24"/>-->

        <TextBlock Text="Product Number:" Grid.Row="1"/>
        <TextBlock Text="Product Model:" Grid.Row="2"/>
        <TextBlock Text="Category:" Grid.Row="3"/>
        <TextBlock Text="Color:" Grid.Row="4"/>
        <TextBlock Text="Standard Cost:" Grid.Row="5"/>
        <TextBlock Text="List Price:" Grid.Row="6"/>
        <TextBlock Text="Size:" Grid.Row="7"/>
        <TextBlock Text="Weight:" Grid.Row="8"/>
        <TextBlock Text="Sell Start Date:" Grid.Row="9"/>
        <TextBlock Text="Sell End Date:" Grid.Row="10"/>

        <TextBlock Text="{Binding ProductNumber}" Grid.Column="1" Grid.Row="1"/>
        <TextBlock Text="{Binding ProductModel.Name}" Grid.Column="1" Grid.Row="2" TextWrapping="Wrap"/>
        <TextBlock Text="{Binding ProductCategory.Name}" Grid.Column="1" Grid.Row="3"/>
        <StackPanel Orientation="Horizontal" Grid.Column="1" Grid.Row="4">
            <Border Width="12" Height="12" Margin="0 0 5 0" Background="{Binding Color, Converter={StaticResource colorConverter}}"/>
            <TextBlock Text="{Binding Color, Converter={StaticResource nullStringConverter}}" />
        </StackPanel>
        <TextBlock Text="{Binding StandardCost, Converter={StaticResource priceConverter}}" Grid.Column="1" Grid.Row="5"/>
        <TextBlock Text="{Binding ListPrice, Converter={StaticResource priceConverter}}" Grid.Column="1" Grid.Row="6"/>
        <TextBlock Text="{Binding Size}" Grid.Column="1" Grid.Row="7"/>
        <TextBlock Text="{Binding Weight, Converter={StaticResource nullStringConverter}}" Grid.Column="1" Grid.Row="8"/>
        <TextBlock Text="{Binding SellStartDate, Converter={StaticResource dateTimeConverter}, ConverterParameter=d}" Grid.Column="1" Grid.Row="9"/>
        <TextBlock Text="{Binding SellEndDate, Converter={StaticResource dateTimeConverter}, ConverterParameter=d}" Grid.Column="1" Grid.Row="10"/>

        <ScrollViewer Grid.Row="1"  Grid.Column="2" Grid.ColumnSpan="2" Grid.RowSpan="12" VerticalScrollBarVisibility="Auto">
            <StackPanel Orientation="Vertical">
                <Image Source="{Binding ThumbNailPhoto, Converter={StaticResource imageFromDBConverter}}" MaxWidth="150" MaxHeight="100" HorizontalAlignment="Left" Grid.Row="1" Grid.RowSpan="6" />
                <TextBlock Text="{Binding ProductModel, Converter={StaticResource productDescriptionConverter}}" TextWrapping="Wrap" Grid.Column="2" Grid.Row="7" Grid.RowSpan="5" VerticalAlignment="Top" />
            </StackPanel>
        </ScrollViewer>

    </Grid>
</UserControl>
