<UserControl x:Class="DataViewDashboard.Views.OrderTile"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:c1="http://schemas.componentone.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 />
        </Grid.RowDefinitions>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="Auto"/>
            <ColumnDefinition />
            <ColumnDefinition Width="Auto"/>
            <ColumnDefinition Width="Auto"/>
        </Grid.ColumnDefinitions>

        <TextBlock Text="Purchase Number:"/>
        <TextBlock Text="Account Number:" Grid.Row="1"/>
        <TextBlock Text="Company:" Grid.Row="2"/>
        <TextBlock Text="Sales Person:" Grid.Row="3"/>
        <TextBlock Text="Order Date:" Grid.Row="4"/>
        <TextBlock Text="Due Date:" Grid.Row="5"/>
        <TextBlock Text="Ship Date:" Grid.Row="6"/>
        <TextBlock Text="Status:" Grid.Row="7"/>
        <TextBlock Text="Online Order:" Grid.Row="8"/>
        <TextBlock Text="Last Modified:" Grid.Row="9"/>

        <TextBlock Text="{Binding PurchaseOrderNumber}" Grid.Column="1"/>
        <TextBlock Text="{Binding AccountNumber}" Grid.Column="1" Grid.Row="1"/>
        <TextBlock Text="{Binding Customer.CompanyName}" Grid.Column="1" Grid.Row="2" TextWrapping="Wrap"/>
        <TextBlock Text="{Binding Customer.SalesPerson, Converter={StaticResource salesPersonNameConverter}}" Grid.Column="1" Grid.Row="3"/>
        <TextBlock Text="{Binding OrderDate, Converter={StaticResource dateTimeConverter}, ConverterParameter=d}" Grid.Column="1" Grid.Row="4"/>
        <TextBlock Text="{Binding DueDate, Converter={StaticResource dateTimeConverter}, ConverterParameter=d}" Grid.Column="1" Grid.Row="5"/>
        <TextBlock Text="{Binding ShipDate, Converter={StaticResource dateTimeConverter}, ConverterParameter=d}" Grid.Column="1" Grid.Row="6"/>
        <StackPanel Orientation="Horizontal" Grid.Column="1" Grid.Row="7">
            <Border Margin="0 0 5 0" Width="12" Height="12" CornerRadius="6" Background="{Binding Status, Converter={StaticResource statusColorConverter}}"/>
            <TextBlock Text="{Binding Status, Converter={StaticResource statusLabelConverter}}" />
        </StackPanel>
        <TextBlock Text="{Binding OnlineOrderFlag}" Grid.Column="1" Grid.Row="8"/>
        <TextBlock Text="{Binding ModifiedDate, Converter={StaticResource dateTimeConverter}, ConverterParameter=d}" Grid.Column="1" Grid.Row="9"/>

        <TextBlock Text="Sub Total:" Grid.Column="2" Grid.Row="1"/>
        <TextBlock Text="Tax Amount:" Grid.Column="2" Grid.Row="2"/>
        <TextBlock Text="Freight:" Grid.Column="2" Grid.Row="3"/>
        <TextBlock Text="Total Due:" Grid.Column="2" Grid.Row="4"/>

        <TextBlock Text="{Binding SubTotal, Converter={StaticResource priceConverter}}" Grid.Column="3" Grid.Row="1" HorizontalAlignment="Right"/>
        <TextBlock Text="{Binding TaxAmt, Converter={StaticResource priceConverter}}" Grid.Column="3" Grid.Row="2" HorizontalAlignment="Right"/>
        <TextBlock Text="{Binding Freight}" Grid.Column="3" Grid.Row="3" HorizontalAlignment="Right"/>
        <TextBlock Text="{Binding TotalDue, Converter={StaticResource priceConverter}}" Grid.Column="3" Grid.Row="4" HorizontalAlignment="Right"/>

    </Grid>
</UserControl>
