Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
585
Trouble populating ListScheduleDataConnector with custom objects
posted

Hi,

I have created appointment and resource property mappings for my ListScheduleDataConnector:

<ig:ListScheduleDataConnector x:Name="lsdMyTasks" >
            <ig:ListScheduleDataConnector.ResourcePropertyMappings>
                <ig:ResourcePropertyMappingCollection>
                    <ig:ResourcePropertyMapping ResourceProperty="Id" DataObjectProperty="UserId"/>
                    <ig:ResourcePropertyMapping ResourceProperty="Name" DataObjectProperty="FullName"/>
                </ig:ResourcePropertyMappingCollection>
            </ig:ListScheduleDataConnector.ResourcePropertyMappings>
            <ig:ListScheduleDataConnector.AppointmentPropertyMappings>
                <ig:AppointmentPropertyMappingCollection>
                    <ig:AppointmentPropertyMapping AppointmentProperty="Start" DataObjectProperty="RequiredDate"/>
                    <ig:AppointmentPropertyMapping AppointmentProperty="Description" DataObjectProperty="TaskTypeName"/>
                    <ig:AppointmentPropertyMapping AppointmentProperty="End" DataObjectProperty="TaskEndTime"/>
                    <ig:AppointmentPropertyMapping AppointmentProperty="Id" DataObjectProperty="TaskId"/>
                    <ig:AppointmentPropertyMapping AppointmentProperty="OwningResourceId" DataObjectProperty="AssignedUserId"/>
                </ig:AppointmentPropertyMappingCollection>
            </ig:ListScheduleDataConnector.AppointmentPropertyMappings>
        </ig:ListScheduleDataConnector>

        <ig:XamScheduleDataManager x:Name="xsdMyTasks" DataConnector="{Binding ElementName=lsdMyTasks}"/>

<ig:XamDateNavigator x:Name="xDateNav" AllowLeadingAndTrailingGroupActivation="False"
                             Dimensions="1,1" AutoAdjustDimensions="False"
                             VerticalAlignment="Top" TodayButtonVisibility="Visible"
                             Margin="0,40,0,0" HighlightDayCriteria="DaysWithActivity"
                             DataManager="{Binding ElementName=xsdMyTasks}"/>

<ig:XamOutlookCalendarView x:Name="xocMyTasks" Grid.Row="1" 
                                       DateNavigator="{Binding ElementName=xDateNav}"
                                           DataManager="{Binding ElementName=xsdMyTasks}"/>

Which I populate in code with entities from the database:

Private Sub MyTasksLoaded(lo As loadoperation)
        If lo.HasError Then
            lo.MarkErrorAsHandled()
            MessageBox.Show(String.Format("Error loading my tasks:  {0}", lo.Error.Message))
        Else
            lsdMyTasks.AppointmentItemsSource = Nothing
            lsdMyTasks.AppointmentItemsSource = lo.Entities.OfType(Of Data.Task).ToList
            lsdMyTasks.ResourceItemsSource = New List(Of User) From {LoggedInUser}
            xsdMyTasks.CurrentUserId = LoggedInUser.UserId
        End If
    End Sub

However I still can't see any of these appointments highlighted in my DateNavigator, or within the xamOutlookCalendarView that I am using.  What am I missing here?