<Window x:Class="TutorialsWPF.MasterDetailBinding"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        Title="MasterDetailBinding" Height="563" Width="946" xmlns:c1="http://schemas.componentone.com/winfx/2006/xaml" xmlns:my="clr-namespace:TutorialsWPF">
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition/>
            <RowDefinition/>
        </Grid.RowDefinitions>
        <c1:C1DataSource Name="c1DataSource1" ContextType="my:NORTHWNDEntities">
            <c1:EntityViewSource EntitySetName="Categories" />
        </c1:C1DataSource>
        <!-- Master grid showing Categories. -->
        <DataGrid AutoGenerateColumns="True" Margin="4" Name="dataGrid1" ItemsSource="{Binding ElementName=c1DataSource1, Path=Categories}"/>
        <!-- Detail grid showing Products of the current Category. -->
        <DataGrid AutoGenerateColumns="True" Margin="4,0,4,4" Grid.Row="1" Name="dataGrid2" ItemsSource="{Binding ElementName=c1DataSource1, Path=Categories/Products}" >
            <!-- This control handler converts navigation property columns, such as Category, to lookup columns. -->
            <c1:C1DataSource.ControlHandler>
                <c1:ControlHandler AutoLookup="True" />
            </c1:C1DataSource.ControlHandler>
        </DataGrid>
    </Grid>
</Window>
