<Window x:Class="WCF_DataServiceExample.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation"
        xmlns:my="clr-namespace:WCF_DataServiceExample"
        Title="MainWindow" Height="350" Width="525">
    <Window.Resources>
        <my:ViewModel x:Key="viewModel" />
    </Window.Resources>
    <Grid DataContext="{StaticResource viewModel}">
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto" />
            <RowDefinition Height="*" />
        </Grid.RowDefinitions>
        
        <telerik:RadDataServiceDataSource x:Name="rdsds" AutoLoad="True" QueryName="{Binding SelectedItem, ElementName=queryNamesCombo}">
            <telerik:RadDataServiceDataSource.DataServiceContext>
                <my:MyNorthwindEntities />
            </telerik:RadDataServiceDataSource.DataServiceContext>
        </telerik:RadDataServiceDataSource>
        
        <StackPanel Grid.Row="0">
            <telerik:RadComboBox x:Name="queryNamesCombo" ItemsSource="{Binding QueryNames}"/>
            <telerik:RadDataPager x:Name="pager" Source="{Binding DataView, ElementName=rdsds}" 
                                  PageSize="10"/>
        </StackPanel>
        
        <telerik:RadGridView x:Name="radGridView" Grid.Row="1" ItemsSource="{Binding PagedSource, ElementName=pager}" />
    </Grid>
</Window>
