<UserControl x:Class="TutorialsSilverlight.SimpleBinding"
    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"
    mc:Ignorable="d"
    d:DesignHeight="554" d:DesignWidth="1151" xmlns:c1="http://schemas.componentone.com/winfx/2006/xaml" xmlns:sdk="http://schemas.microsoft.com/winfx/2006/xaml/presentation/sdk" xmlns:riaControls="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.DomainServices">
    <Grid>
        <!-- Define a C1DataSource with specified DomainContextTypeName. View sources are defined inside a C1DataSource. -->
        <c1:C1DataSource Name="c1DataSource1" DomainContextTypeName="TutorialsSilverlight.Web.DomainService1">
            <!-- A view source of Products. -->
            <c1:RiaViewSource QueryName="GetProducts">
                <c1:RiaViewSource.FilterDescriptors>
                    <!-- Display discontinued products only. Perform the filtering on the server. -->
                    <riaControls:FilterDescriptor Operator="IsEqualTo" PropertyPath="Discontinued" Value="true" />
                </c1:RiaViewSource.FilterDescriptors>
                <c1:RiaViewSource.SortDescriptors>
                    <!-- Sort the products by ProductID. -->
                    <riaControls:SortDescriptor PropertyPath="ProductID" />
                </c1:RiaViewSource.SortDescriptors>
            </c1:RiaViewSource>
        </c1:C1DataSource>
        
        <!-- A C1FlexGrid bound to the Products RiaViewSource defined above. -->
        <c1:C1FlexGrid AutoGenerateColumns="True" Name="dataGrid1" ItemsSource="{Binding [GetProducts], ElementName=c1DataSource1}" >
            <!-- This control handler converts navigation property columns, such as Category, to lookup columns. -->
            <c1:C1DataSource.ControlHandler>
                <c1:ControlHandler AutoLookup="True"/>
            </c1:C1DataSource.ControlHandler>
        </c1:C1FlexGrid>
    </Grid>
</UserControl>
