<controls:ChildWindow x:Class="TransactionsSilverlight.OrderWindow"
           xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
           xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
           xmlns:controls="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls"
           xmlns:sdk="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Data"  
           Width="400" Height="400" 
           Title="Edit Order" Closed="ChildWindow_Closed">
    <Grid x:Name="LayoutRoot" Margin="2">
        <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,  Mode=TwoWay}"/>

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

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

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

        <!-- A DataGrid showing Order Details. -->
        <sdk:DataGrid AutoGenerateColumns="False" Grid.Row="5" Grid.ColumnSpan="2" Name="orderDetailsGrid" >
            <sdk:DataGrid.Columns>
                <sdk:DataGridTextColumn Header="OrderID" Binding="{Binding OrderID}" Width="70"/>
                <sdk:DataGridTextColumn Header="ProductID" Binding="{Binding ProductID}" Width="70"/>
                <sdk:DataGridTextColumn Header="UnitPrice" Binding="{Binding UnitPrice}"/>
                <sdk:DataGridTextColumn Header="Discount" Binding="{Binding Discount}"/>
                <sdk:DataGridTextColumn Header="Quantity" Binding="{Binding Quantity}"/>
            </sdk:DataGrid.Columns>
        </sdk: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>
</controls:ChildWindow>