<Window x:Class="OrderWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        Title="Order" Height="437" Width="380" WindowStartupLocation="CenterScreen">
    <Grid>
        <Grid.ColumnDefinitions>
            <ColumnDefinition/>
            <ColumnDefinition/>
        </Grid.ColumnDefinitions>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="Auto"/>
            <RowDefinition />
            <RowDefinition Height="Auto"/>
        </Grid.RowDefinitions>

        <!-- Text boxes for properties of the Order. -->
        <TextBlock Margin="3" Text="ID:"/>
        <TextBox Margin="3" Grid.Column="1" Text="{Binding OrderID}"/>

        <TextBlock Margin="3" Grid.Row="1" Text="Freight:"/>
        <TextBox Margin="3" Grid.Row="1" Grid.Column="1" Text="{Binding Freight}"/>

        <TextBlock Margin="3" Grid.Row="2" Text="Order date:"/>
        <TextBox Margin="3" Grid.Row="2" Grid.Column="1" Text="{Binding OrderDate}"/>

        <TextBlock Margin="3" Grid.Row="3" Text="Ship name:"/>
        <TextBox Margin="3" Grid.Row="3" Grid.Column="1" Text="{Binding ShipName}"/>

        <TextBlock Margin="3" Grid.Row="4" Text="Ship city:"/>
        <TextBox Margin="3" Grid.Row="4" Grid.Column="1" Text="{Binding ShipCity}"/>

        <!-- A DataGrid showing Order Details. -->
        <DataGrid AutoGenerateColumns="False" Grid.Row="5" Grid.ColumnSpan="2" Name="orderDetailsGrid" >
            <DataGrid.Columns>
                <DataGridTextColumn Header="OrderID" Binding="{Binding OrderID}" Width="70"/>
                <DataGridTextColumn Header="ProductID" Binding="{Binding ProductID}" Width="70"/>
                <DataGridTextColumn Header="UnitPrice" Binding="{Binding UnitPrice}"/>
                <DataGridTextColumn Header="Discount" Binding="{Binding Discount}"/>
                <DataGridTextColumn Header="Quantity" Binding="{Binding Quantity}"/>
            </DataGrid.Columns>
        </DataGrid>

        <!-- OK and Cancel buttons. -->
        <StackPanel Grid.Row="6" HorizontalAlignment="Right" Margin="3" Orientation="Horizontal" Grid.ColumnSpan="2">
            <Button Width="70" Margin="2" Click="ok_Click">OK</Button>
            <Button Width="70" Margin="2" Click="cancel_Click">Cancel</Button>
        </StackPanel>
    </Grid>
</Window>
