<UserControl x:Class="TransactionsSilverlight.MainPage"
    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:ctl="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls"
    mc:Ignorable="d"
    d:DesignHeight="500" d:DesignWidth="750">

    <Grid x:Name="LayoutRoot" Background="White">
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="260"/>
            <ColumnDefinition Width="500" />
        </Grid.ColumnDefinitions>

        <!-- Left pane with lists of cities and customers. -->
        <StackPanel Grid.ColumnSpan="3" Margin="0,0,500,0">
            <!-- A combo box showing cities. -->
            <TextBlock Padding="6,4,0,4" Text="City: " VerticalAlignment="Center"/>
            <ComboBox Grid.Column="0" Margin="4,0,4,4" x:Name="comboCity" DisplayMemberPath="City"/>

            <!-- The list of customers of the selected city. -->
            <StackPanel Orientation="Horizontal">
                <TextBlock Padding="6,4,0,4" Text="Customers: " VerticalAlignment="Center"/>
                <Button Margin="112,4,0,4" Content="Edit Orders" Name="button1" Click="button1_Click" />
            </StackPanel>
            <ListBox ItemsSource="{Binding SelectedItem.Customers, ElementName=comboCity}" x:Name="listCustomers" DisplayMemberPath="ContactName" BorderThickness="0" />
        </StackPanel>

        <!-- Pages in this tab control allow editing the customers. -->
        <ctl:TabControl x:Name="tabs" Grid.Column="2"/>
    </Grid>
</UserControl>
