Recurrence Rule
RadCalendar includes support for recurring events on daily, weekly, monthly and yearly basis. Exceptions to the recurrence rules are also permitted. To support this recurrence behavior, the Telerik.XamarinForms.Input.Appointment class includes the RecurrenceRule property. When an appointment is promoted into a recurring event its RecurrenceRule is set with correct RecurrencePattern.
The purpose of this tutorial is to show you:
-
The main properties exposed by the RecurrenceRule class:
How to create a recurrence rule and associate it with an appointment
RecurrenceRule Class
While the RecurrencePattern class carries the main information about the occurrences, the RecurrenceRule class is the engine for creating and evaluating recurrence rules.
The next several sections describe which are the main properties and methods exposed by the RecurrenceRule class.
RecurrencePattern
The RecurrenceRule class exposes a RecurrencePattern property, which allows you to get\set the recurrence pattern associated with the current rule. For more information about creating various recurrence patterns, take a look at the RecurrencePattern topic.
Exceptions
The RecurrenceRule class exposes an Exceptions property, which allows you to get or set all exception occurrences associated with the current rule. For more information read How to Add Exception Occurrences to the Recurrence Rule
How to Create a Recurrence Rule and Associate it With an Appointment
The above example shows you how to create a recurrence pattern, then how to associate it with a recurrence rule. Finally the recurrence rule is assigned to an appointment.
How to Add Exception Occurrences to the Recurrence Rule
RadCalendar's API permits you to add exception occurrences to the recurrence rule. You could add exceptions directly to the RecurrenceRule's Exceptions collection.
Exceptions collection contains a list of ExceptionOccurrence objects where each ExceptionOccurrence includes:
ExceptionDate: DateTime which indicates when the exception occurs. You can set only ExceptionDate to remove the given occurrence from the recurrence.
Appointment: Refers to the exception appointment.
One possible scenario of adding an exception to a recurrence rule is shown in the next example: