<UserControl x:Class="RIAPoweredSilverlightApplication.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"
    mc:Ignorable="d"
    d:DesignHeight="500" d:DesignWidth="400" 
        xmlns:riaControls="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.DomainServices" 
        xmlns:my="clr-namespace:RIAPoweredSilverlightApplication.Web.Model" 
        xmlns:my1="clr-namespace:RIAPoweredSilverlightApplication.Web.Services" 
        xmlns:sdk="http://schemas.microsoft.com/winfx/2006/xaml/presentation/sdk">

    <Grid x:Name="LayoutRoot" Background="White" Width="400" Height="500">
        <riaControls:DomainDataSource AutoLoad="True" d:DesignData="{d:DesignInstance my:ProductCategory, CreateList=true}" Height="0" LoadedData="productCategoryDomainDataSource_LoadedData" Name="productCategoryDomainDataSource" QueryName="GetProductCategoryQuery" Width="0">
            <riaControls:DomainDataSource.DomainContext>
                <my1:AdventureWorksDomainContext />
            </riaControls:DomainDataSource.DomainContext>
        </riaControls:DomainDataSource>
        <sdk:DataGrid AutoGenerateColumns="False" Height="200" HorizontalAlignment="Left" ItemsSource="{Binding ElementName=productCategoryDomainDataSource, Path=Data}" Margin="0,12,0,0" Name="productCategoryDataGrid" RowDetailsVisibilityMode="VisibleWhenSelected" VerticalAlignment="Top" Width="360">
            <sdk:DataGrid.Columns>
                <sdk:DataGridTemplateColumn x:Name="modifiedDateColumn" Header="Modified Date" Width="SizeToHeader">
                    <sdk:DataGridTemplateColumn.CellEditingTemplate>
                        <DataTemplate>
                            <sdk:DatePicker SelectedDate="{Binding Path=ModifiedDate, Mode=TwoWay, NotifyOnValidationError=true, ValidatesOnExceptions=true}" />
                        </DataTemplate>
                    </sdk:DataGridTemplateColumn.CellEditingTemplate>
                    <sdk:DataGridTemplateColumn.CellTemplate>
                        <DataTemplate>
                            <TextBlock Text="{Binding Path=ModifiedDate, StringFormat=\{0:d\}}" />
                        </DataTemplate>
                    </sdk:DataGridTemplateColumn.CellTemplate>
                </sdk:DataGridTemplateColumn>
                <sdk:DataGridTextColumn x:Name="nameColumn" Binding="{Binding Path=Name}" Header="Name" Width="SizeToHeader" />
                <sdk:DataGridTextColumn x:Name="productCategoryIDColumn" Binding="{Binding Path=ProductCategoryID, Mode=OneWay}" Header="Product Category ID" IsReadOnly="True" Width="SizeToHeader" />
                <sdk:DataGridTextColumn x:Name="rowguidColumn" Binding="{Binding Path=rowguid}" Header="Rowguid" Width="SizeToHeader" />
            </sdk:DataGrid.Columns>
        </sdk:DataGrid>
        <sdk:DataGrid ItemsSource="{Binding}" AutoGenerateColumns="True" Height="200" HorizontalAlignment="Left" Margin="0,218,0,0" Name="dataGrid1" VerticalAlignment="Top" Width="360" />
        <Button Content="Change data" Height="23" HorizontalAlignment="Left" Margin="0,424,0,0" Name="btnChangeData" VerticalAlignment="Top" Width="123" Click="btnChangeData_Click" />
    </Grid>
</UserControl>
