AppointmentItem Class
The planned event a scheduler view displays.
Namespace: DevExpress.XamarinForms.Scheduler
Assembly: DevExpress.XamarinForms.Scheduler.dll
NuGet Package: DevExpress.XamarinForms.Scheduler
Declaration
public class AppointmentItem :
SourceObjectContainer
Related API Members
The following members return AppointmentItem objects:
Remarks
A scheduler view displays appointment items stored in the AppointmentItems collection of the SchedulerDataStorage object assigned to the view’s DataStorage property.
To bind a scheduler view to an external data source of appointments, set the SchedulerDataStorage.DataSource property to a DataSource object and bind the DataSource.AppointmentsSource property to a collection of appointment objects. The DataSource.AppointmentMappings property specifies how to convert source objects to appointments.
Note
The AppointmentItems collection is always synchronous with the scheduler storage’s DataSource when the source is specified.
You can use the DataSource.CreateSourceObject event to create a source object that is assigned to a new item, if the source objects’ type does not provide a parameterless constructor.
Appointment Data
The appointment provides the following general properties that configure data it represents:
Index | Property | Description |
---|---|---|
1 | Gets or sets the start date and time of the appointment. | |
2 | Gets or sets the end date and time of the appointment. | |
3 | Gets or sets the identifier of the label object associated with the appointment. | |
4 | Gets or sets the appointment’s subject text. | |
5 | Gets or sets whether the appointment lasts the entire day (or several days). |
Note that the appointment item’s LabelId should be equal to Id of any AppointmentLabelItem from the SchedulerDataStorage.LabelItems collection.
Appointment Appearance
Appointments are displayed differently depending on the scheduler view type:
The table below lists scheduler view properties that manage appointment appearance:
Property | Description |
---|---|
Gets or sets appearance settings of appointments. | |
Gets or sets a data template that specifies the representation of appointments. | |
Gets or sets appearance settings of all-day appointments. | |
Gets or sets a data template that specifies the representation of all-day appointments. | |
Gets or sets appearance settings of appointments. | |
Gets or sets a data template that specifies the Xamarin.Forms.View the Month View uses to show appointments. |
Recurrence
Appointment Types
The scheduler can display appointments that occur only once (normal appointments) or repeat several times (recurring appointments), and can generate a series of occurrences by a pattern. If users change an occurrence appointment or delete it, the appointment type will change to changed occurrence or deleted occurrence respectively. The following image summarizes information about appointments and the list the available types:
- Normal Appointment
- Occurrence
- Changed Occurrence
- Deleted Occurrence
Note
Your data source should not contain common occurrences. The scheduler generates them automatically. But the data source should store deleted occurrences and changed occurrences to be able to restore changes.
The appointment item provides several properties that allow you to determine what the appointment type is. The table below lists their values for different appointment types:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Recurrence Info
The pattern appointment’s AppointmentItem.RecurrenceInfo property provides data about the periodicity of occurrences generated by the pattern. The property returns instances of classes that implement the IRecurrenceInfo interface. Generally it is RecurrenceInfo objects.
A scheduler view uses this information to generate occurrence appointments, and the OccurrenceCalculator can compute parameters of occurrences with this information.
Properties
All recurrence info properties are split into two groups:
Properties that manage how long occurrences appear. The Range property manages which properties from this group the calculator uses to generate occurrences:
RecurrenceRange Value
Used properties
EndByDate
OccurrenceCount
NoEndDate
Properties that manage how often occurrences appear. The Type property manages which properties from this group the calculator uses to generate occurrences:
RecurrenceType Value
Used properties
Daily
Weekly
Monthly
Yearly
Important
The AppointmentItem.RecurrenceInfo property returns null
if AppointmentItem.Type is not Pattern.
Storage Methods
A scheduler view’s data storage provides the following methods that allow you to obtain information about pattern occurrences and exceptions, and about occurrence patterns:
Method | Description |
---|---|
Returns a pattern of the specified occurrence or exception. | |
Returns a pattern that utilizes recurrence information with the specified identifier. | |
Returns all exceptions to the specified pattern. | |
Returns all exceptions to a pattern that use the recurrence info with the specified identifier. | |
Returns an occurrence or exception under the specified recurrence index from the recurring chain the given pattern specifies. | |
Returns an occurrence or exception under the specified recurrence index from the recurring chain which the recurrence info with the given identifier specifies. | |
Returns all occurrences and exceptions to the specified pattern that are within the given date-time interval. | |
Returns all occurrences and exceptions to a pattern that use the recurrence info with the specified identifier. |