<UserControl x:Class="SilverlightApplication1.MainPage"
    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"
    xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation"
	xmlns:e="clr-namespace:SilverlightApplication1.Web.Services"
    mc:Ignorable="d"
    d:DesignHeight="300" d:DesignWidth="400">

	<Grid>
		<Grid.RowDefinitions>
			<RowDefinition />
			<RowDefinition Height="Auto" />
			<RowDefinition Height="200" />
		</Grid.RowDefinitions>

		<telerik:RadDomainDataSource x:Name="customersDataSource" 
									 LoadingData="OnCustomersDataSourceLoadingData"
									 LoadedData="OnCustomersDataSourceLoadedData">
			<telerik:RadDomainDataSource.DomainContext>
				<e:NorthwindDomainContext />
			</telerik:RadDomainDataSource.DomainContext>
			<telerik:RadDomainDataSource.SortDescriptors>
				<telerik:SortDescriptor Member="CustomerID" SortDirection="Ascending"/>
			</telerik:RadDomainDataSource.SortDescriptors>
		</telerik:RadDomainDataSource>

		<telerik:RadGridView x:Name="radGridView" 
							 Grid.Row="0"
							 ItemsSource="{Binding PagedSource, ElementName=radDataPager}"
							 IsBusy="{Binding IsBusy, ElementName=customersDataSource}"
							 ShowGroupPanel="False"
							 AutoGeneratingColumn="OnRadGridViewAutoGeneratingColumn"
							 IsReadOnly="True"/>
		<telerik:RadDataPager x:Name="radDataPager" 
							  Grid.Row="1" 
							  Source="{Binding DataView, ElementName=customersDataSource}" 
							  DisplayMode="All"
							  IsTotalItemCountFixed="True"/>
		<ScrollViewer Grid.Row="2" x:Name="debugScrollViewer">
			<TextBox x:Name="debugTextBox" 
					 FontSize="12" 
					 HorizontalScrollBarVisibility="Auto"
					 VerticalScrollBarVisibility="Auto"
					 TextChanged="OnDebugTextBoxTextChanged"/>
		</ScrollViewer>
		
	</Grid>
</UserControl>
