Version

Using Calendars Items Source

XamSchedule supports the ability to have one or more calendars associated with a given resource. An activity is associated with a specific calendar of a specific resource via its OwningCalendarId and OwnerResourceId properties. For the ListScheduleDataConnector, the ResourceCalendarItemsSource is used to provide the datasource from which the calendars collection will be generated. A calendar in the ResourceCalendarsItemsSource is associated with its owning resource via its OwningResourceId property.

Note that since the ability to support multiple calendars will not be needed by all applications, the ResourceCalendarItemsSource is optional. When not provided the connector will create a default calendar as the PrimaryCalendar for each resource and the activities will be associated with that calendar. Also note that when ResourceCalendarItemsSource is not provided, the activity’s OwningCalendarId property mapping is not required.

In XAML:

<ig:ListScheduleDataConnector
    x:Name="scheduleDataConnector"
    ResourceItemsSource="{Binding Resources}"
    ResourceCalendarItemsSource="{Binding Calendars}"
    AppointmentItemsSource="{Binding Appointments}" />
<ig:XamScheduleDataManager
    x:Name="dataManager"
    DataConnector="{Binding ElementName=scheduleDataConnector}">
    <ig:XamScheduleDataManager.CalendarGroups>
        <ig:CalendarGroup
            InitialCalendarIds="own1,own2[cal1]"
            InitialSelectedCalendarId="own2[cal1]" />
    </ig:XamScheduleDataManager.CalendarGroups>
</ig:XamScheduleDataManager>

In the example above Resource “own1” will be shown with the activities belonging to its Primary Calendar (the first calendar in the ResourceCalendarItemsSource collection if not specified explicitly) and Resource “own2” will be presented only with the activities belonging to ResourceCalendar with Id=“cal1”.