locked
White screen when using DomainDataSource.submitChanges() RRS feed

  • Question

  • I'm using a domainDataSource with the Entity Framework to display data on a third-party scheduler control.

    The data displays okay, but when trying to submit changes, the screen goes white and the applications stops running.

    Can anyone tell me what the problem might be?

    Here's the XAML:

    <navigation:Page x:Class="DataSchedC1SL2.Page1" 
               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"
               xmlns:navigation="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Navigation"
               d:DesignWidth="640" d:DesignHeight="480"
               Title="Page1 Page" xmlns:sdk="http://schemas.microsoft.com/winfx/2006/xaml/presentation/sdk" xmlns:riaControls="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.DomainServices" xmlns:my="clr-namespace:DataSchedC1SL2" xmlns:c1="http://schemas.componentone.com/winfx/2006/xaml">
        
        <Grid x:Name="LayoutRoot">
            
            <ScrollViewer BorderThickness="0"  VerticalScrollBarVisibility="Auto" Padding="12,0,12,0" Margin="-12">
                <StackPanel Margin="0,12,0,12" Orientation="Vertical" >
                    <riaControls:DomainDataSource AutoLoad="True" d:DesignData="{d:DesignInstance my:Appointment, CreateList=true}" Height="0" Name="AppointmentDomainDataSource" QueryName="GetAppointmentsQuery" Width="0">
                        <riaControls:DomainDataSource.DomainContext>
                            <my:AppointmentContext />
                        </riaControls:DomainDataSource.DomainContext>
                    </riaControls:DomainDataSource>
                    <c1:C1Scheduler Name="Schedule1" DataContext="{Binding}" />
                  </StackPanel>
            </ScrollViewer>
    
        </Grid>
    </navigation:Page>
    
     
    and the code-behind:
     
        Private Sub Schedule1_AppointmentChanged(sender As System.Object, e As C1.Silverlight.Schedule.AppointmentActionEventArgs) Handles Schedule1.AppointmentChanged
    
            Dim _AppointmentContext As AppointmentContext = AppointmentDomainDataSource.DomainContext
    
            Dim app As New Appointment
             app.Body = e.Appointment.Body
            app.Location = e.Appointment.Body
            app.Start = e.Appointment.Start
            app.End = e.Appointment.End
            app.Subject = e.Appointment.Subject
            app.Properties = e.Appointment.GetAppointmentProperties()
    
            _AppointmentContext.Appointments.Add(app)
    
            AppointmentDomainDataSource.SubmitChanges()
    
        End Sub
    
    Saturday, February 11, 2012 2:19 AM

Answers

All replies