<Window x:Class="SimpleBinding"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        Title="SimpleBinding" Height="557" Width="1062" xmlns:c1="http://schemas.componentone.com/winfx/2006/xaml" xmlns:my="clr-namespace:TutorialsWPF">
    <Grid>
        <!-- Define a C1DataSource with specified ObjectContextType. View sources are defined inside a C1DataSource. -->
        <c1:C1DataSource Name="c1DataSource1" ContextType="my:NORTHWNDEntities">
            <!-- A view source of Products. -->
            <c1:EntityViewSource EntitySetName="Products">
                <c1:EntityViewSource.FilterDescriptors>
                    <!-- Display discontinued products only. Perform the filtering on the server. -->
                    <c1:FilterDescriptor Operator="IsEqualTo" PropertyPath="Discontinued" Value="true" />
                </c1:EntityViewSource.FilterDescriptors>
                <c1:EntityViewSource.SortDescriptors>
                    <!-- Sort the products by ProductID. -->
                    <c1:SortDescriptor PropertyPath="ProductID" />
                </c1:EntityViewSource.SortDescriptors>
            </c1:EntityViewSource>
        </c1:C1DataSource>
        
        <!-- A C1DataGrid bound to the Products EntityViewSource defined above. -->
        <c1:C1DataGrid CanUserAddRows="False" AutoGenerateColumns="True" Margin="15,15,20,15" Name="dataGrid1" ItemsSource="{Binding ElementName=c1DataSource1, Path=Products}" >
            <!-- This control handler converts navigation property columns, such as Category, to lookup columns. -->
            <c1:C1DataSource.ControlHandler>
                <c1:ControlHandler AutoLookup="True"/>
            </c1:C1DataSource.ControlHandler>
        </c1:C1DataGrid>
    </Grid>
</Window>
