<UserControl x:Class="TutorialsSilverlight.Paging"
    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="410" d:DesignWidth="801" xmlns:sdk="http://schemas.microsoft.com/winfx/2006/xaml/presentation/sdk" xmlns:c1="http://schemas.componentone.com/winfx/2006/xaml" xmlns:riaControls="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.DomainServices">
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition/>
            <RowDefinition Height="Auto"/>
        </Grid.RowDefinitions>
      
        <c1:C1DataSource Name="c1DataSource1" DomainContextTypeName="TutorialsSilverlight.Web.DomainService1">
            <!-- Setting the PageSize property value enables paging in a RiaViewSource. -->
            <c1:RiaViewSource QueryName="GetOrders" PageSize="10"/>
        </c1:C1DataSource>
        <c1:C1DataGrid AutoGenerateColumns="True" Name="dataGrid1" ItemsSource="{Binding [GetOrders], ElementName=c1DataSource1}" >
            <!-- This control handler converts navigation property columns, such as Customer, to lookup columns. -->
            <c1:C1DataSource.ControlHandler>
                <c1:ControlHandler AutoLookup="True"/>
            </c1:C1DataSource.ControlHandler>
        </c1:C1DataGrid>
        <!-- Controls that display and change the current page index. -->
        <StackPanel Orientation="Horizontal" Grid.Row="1" Margin="5">
            <Button Padding="10,0,10,0" Margin="1" Content="&lt;" Click="MoveToPrevPage"/>
            <TextBlock VerticalAlignment="Center" Text="Page: "/>
            <TextBlock VerticalAlignment="Center" x:Name="pageInfo"/>
            <Button Padding="10,0,10,0" Margin="1"  Content="&gt;" Click="MoveToNextPage"/>
        </StackPanel>
    </Grid>
</UserControl>
