<UserControl x:Class="TransactionsSilverlight.CustomerControl"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:sdk="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Data"  
    mc:Ignorable="d"
    d:DesignHeight="386" d:DesignWidth="400">
    
    <Grid x:Name="LayoutRoot" Background="White" >
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="Auto"/>
            <RowDefinition />
        </Grid.RowDefinitions>

        <!-- A DataGrid showing Orders of the current Customer. -->
        <StackPanel Margin="0,5,0,3" Grid.Row="0" >
            <TextBlock Padding="0,4,0,4">Orders:</TextBlock>
            <sdk:DataGrid x:Name="ordersGrid" Height="400" GridLinesVisibility="None" AutoGenerateColumns="False">
                <sdk:DataGrid.Columns>
                    <sdk:DataGridTextColumn Header="ID" Binding="{Binding OrderID}" Width="50"/>
                    <sdk:DataGridTextColumn Header="Order Date" Binding="{Binding OrderDate}" Width="150"/>
                    <sdk:DataGridTextColumn Header="Freight" Binding="{Binding Freight}"/>
                    <sdk:DataGridTextColumn Header="Ship Name" Binding="{Binding ShipName}"/>
                    <sdk:DataGridTextColumn Header="Ship City" Binding="{Binding ShipCity}"/>
                </sdk:DataGrid.Columns>
            </sdk:DataGrid>
        </StackPanel>

        <!-- Add, Edit, and Delete buttons. -->
        <StackPanel Grid.Row="1" Orientation="Horizontal" >
            <Button Width="70" Margin="0,2,1,2" Click="addOrder">Add</Button>
            <Button Width="70" Margin="1,2,2,1" Click="editOrder">Edit</Button>
            <Button Width="70" Margin="1,2,2,1" Click="deleteOrder">Delete</Button>
        </StackPanel>
        <!-- Undo Changes and Close buttons. -->
        <StackPanel Grid.Row="2" HorizontalAlignment="Right" Margin="3" Orientation="Horizontal" >
            <Button Width="93" Margin="2" x:Name="buttonUndo" Click="undo_Click">Undo Changes</Button>
            <Button Width="70" Margin="2" Click="close_Click">Close</Button>
        </StackPanel>
    </Grid>
</UserControl>
