<UserControl x:Class="CRUDSampleApplication.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:web="clr-namespace:CRUDSampleApplication.Web"
    mc:Ignorable="d"
    d:DesignHeight="300" d:DesignWidth="400">

    <Grid x:Name="LayoutRoot" Background="White">
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto" />
            <RowDefinition Height="*" />
        </Grid.RowDefinitions>
        <telerik:RadDomainDataSource x:Name="radDomainDataSource" AutoLoad="True"
                                     QueryName="GetOrder_Details">
            <telerik:RadDomainDataSource.DomainContext>
                <web:NorthwindContext />
            </telerik:RadDomainDataSource.DomainContext>
        </telerik:RadDomainDataSource>
        <StackPanel Grid.Row="0">
            <telerik:RadButton x:Name="submitChangesButton" Content="Submit Changes"
                               Command="{Binding SubmitChangesCommand, ElementName=radDomainDataSource}" 
                               CommandTarget="{Binding ElementName=radDomainDataSource}"/>
            <telerik:RadButton x:Name="rejectChangesButton" Content="Reject Changes" 
                               Command="{Binding RejectChangesCommand, ElementName=radDomainDataSource}" 
                               CommandTarget="{Binding ElementName=radDomainDataSource}"/>
        </StackPanel>
        <telerik:RadGridView x:Name="radGridView" Grid.Row="1"
                             ItemsSource="{Binding DataView, ElementName=radDomainDataSource}"
                             IsBusy="{Binding IsBusy, ElementName=radDomainDataSource}"
                             ShowInsertRow="True">
        </telerik:RadGridView>
    </Grid>
</UserControl>
