When an appointment object’s Recurrence property is set it becomes the root of a series of recurring instances of the appointment. Each of these instances is referred to as an ‘occurrence’ of the appointment. When changes are made to a specific ‘occurrence’ it is known as a ‘variance’; for example, when an appointment is set for every Monday at 10:00am but on a specific week it is moved to 10:30.
Normally the root appointment and any variances are stored in the AppointmentItemSource along with all the other appointments. Note: Non-variance occurrences are not stored at all since they can be generated from the root appointment for any date span based on the appointment’s recurrence rules.
However, if the RecurringAppointmentItemsSource is set, both the root appointments as well as the variances will be stored in that data source. Segregating root appointments and variances allows the connector to optimize retrieval of all appointments. The reason for this is that the root appointments end up generating occurrences into the future. So, for example, if xamMonthView needs to display the appointments for November 2010, it needs to get all root appointments that were created in the past that would generate occurrences in November 2010. Segregating these appointments allows more efficient retrieval by the ListScheduleDataConnector. Also if these appointments are segregated in their own items source then the properties relating to recurrences and variances don’t need to be mapped in the AppointmentItemSource - they only need to be mapped in the RecurringAppointmentItemSource.
Note that when RecurringAppointmentItemsSource is set, the root appointments and variances must only be included in this data source. They cannot be included in the AppointmentsItemsSource. AppointmentItemsSource should only include non-recurring appointments when RecurringAppointmentItemsSource is provided.
As with all other item source collections defined in ListScheduleDataConnector, RecurringAppointmentItemsSource can be populated with an IEnumerable collection of Appointment entities (with defined Recurrence property) or with an IEnumerable collection of custom entities. In the latter case the developer must provide the proper RecurringAppointmentPropertyMappings that provide information regarding properties of the custom entity and what information each of those properties provide. Here is how it is done:
<ig:ListScheduleDataConnector
x:Name="scheduleDataConnector"
ResourceItemsSource="{Binding Resources}"
ResourceCalendarItemsSource="{Binding Calendars}"
AppointmentItemsSource="{Binding Appointments}"
RecurringAppointmentItemsSource="{Binding RecurringAppointments}">
<ig:ListScheduleDataConnector.RecurringAppointmentPropertyMappings>
<ig:AppointmentPropertyMapping
AppointmentProperty="Id"
DataObjectProperty="Id1" />
<ig:AppointmentPropertyMapping
AppointmentProperty="Start"
DataObjectProperty="Start1" />
<ig:AppointmentPropertyMapping
AppointmentProperty="End"
DataObjectProperty="End1" />
<ig:AppointmentPropertyMapping
AppointmentProperty="OwningResourceId"
DataObjectProperty="OwnerId1" />
<ig:AppointmentPropertyMapping
AppointmentProperty="OwningCalendarId"
DataObjectProperty="CalendarId1" />
<ig:AppointmentPropertyMapping
AppointmentProperty="Subject"
DataObjectProperty="Subject1" />
<ig:AppointmentPropertyMapping
AppointmentProperty="Description"
DataObjectProperty="Text1" />
<ig:AppointmentPropertyMapping
AppointmentProperty="Recurrence"
DataObjectProperty="Recurrence1" />
</ig:ListScheduleDataConnector.RecurringAppointmentPropertyMappings>
</ig:ListScheduleDataConnector>
Dim data = New MyScheduleData()
Dim dataConnector = New ListScheduleDataConnector()
dataConnector.ResourceItemsSource = data.Resources
dataConnector.ResourceCalendarItemsSource = data.Calendars
dataConnector.AppointmentItemsSource = data.Appointments
dataConnector.RecurringAppointmentItemsSource = _
data.RecurringAppointments
dataConnector.RecurringAppointmentPropertyMappings = _
New AppointmentPropertyMappingCollection()
dataConnector.RecurringAppointmentPropertyMappings. _
Add(AppointmentProperty.Id, "Id1")
dataConnector.RecurringAppointmentPropertyMappings. _
Add(AppointmentProperty.Start, "Start1")
dataConnector.RecurringAppointmentPropertyMappings. _
Add(AppointmentProperty.End, "End1")
dataConnector.RecurringAppointmentPropertyMappings. _
Add(AppointmentProperty.OwningResourceId, "OwnerId1")
dataConnector.RecurringAppointmentPropertyMappings. _
Add(AppointmentProperty.OwningCalendarId, "CalendarId1")
dataConnector.RecurringAppointmentPropertyMappings. _
Add(AppointmentProperty.Subject, "Subject1")
dataConnector.RecurringAppointmentPropertyMappings. _
Add(AppointmentProperty.Description, "Text1")
dataConnector.RecurringAppointmentPropertyMappings. _
Add(AppointmentProperty.Recurrence, "Recurrence1")
var data = new MyScheduleData();
var dataConnector = new ListScheduleDataConnector();
dataConnector.ResourceItemsSource = data.Resources;
dataConnector.ResourceCalendarItemsSource = data.Calendars;
dataConnector.AppointmentItemsSource = data.Appointments;
dataConnector.RecurringAppointmentItemsSource =
data.RecurringAppointments;
dataConnector.RecurringAppointmentPropertyMappings =
new AppointmentPropertyMappingCollection();
dataConnector.RecurringAppointmentPropertyMappings.
Add(AppointmentProperty.Id, "Id1");
dataConnector.RecurringAppointmentPropertyMappings.
Add(AppointmentProperty.Start, "Start1");
dataConnector.RecurringAppointmentPropertyMappings.
Add(AppointmentProperty.End, "End1");
dataConnector.RecurringAppointmentPropertyMappings.
Add(AppointmentProperty.OwningResourceId, "OwnerId1");
dataConnector.RecurringAppointmentPropertyMappings.
Add(AppointmentProperty.OwningCalendarId, "CalendarId1");
dataConnector.RecurringAppointmentPropertyMappings.
Add(AppointmentProperty.Subject, "Subject1");
dataConnector.RecurringAppointmentPropertyMappings.
Add(AppointmentProperty.Description, "Text1");
dataConnector.RecurringAppointmentPropertyMappings.
Add(AppointmentProperty.Recurrence, "Recurrence1");