Skip to main content

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

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:

Appointment valuable parameters

Index

Property

Description

1

Start

Gets or sets the start date and time of the appointment.

2

End

Gets or sets the end date and time of the appointment.

3

LabelId

Gets or sets the identifier of the label object associated with the appointment.

4

Subject

Gets or sets the appointment’s subject text.

5

AllDay

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

DayViewBase.AppointmentStyle

Gets or sets appearance settings of appointments.

DayViewBase.AppointmentTemplate

Gets or sets a data template that specifies the representation of appointments.

DayViewBase.AllDayAppointmentStyle

Gets or sets appearance settings of all-day appointments.

DayViewBase.AllDayAppointmentTemplate

Gets or sets a data template that specifies the representation of all-day appointments.

MonthView.AppointmentStyle

Gets or sets appearance settings of appointments.

MonthView.AppointmentTemplate

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:

Appointment Types

  1. Normal Appointment
  2. Occurrence
  3. Changed Occurrence
  4. 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:

Type

IsRecurring

IsBase

IsOccurrence

IsException

Normal

false

true

false

false

Pattern

true

true

false

false

Occurrence

true

false

true

false

ChangedOccurrence

true

false

true

true

DeletedOccurrence

true

false

true

true

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:

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

GetPattern(AppointmentItem)

Returns a pattern of the specified occurrence or exception.

GetPattern(Object)

Returns a pattern that utilizes recurrence information with the specified identifier.

GetExceptions(AppointmentItem)

Returns all exceptions to the specified pattern.

GetExceptions(Object)

Returns all exceptions to a pattern that use the recurrence info with the specified identifier.

GetOccurrenceOrException(AppointmentItem, Int32)

Returns an occurrence or exception under the specified recurrence index from the recurring chain the given pattern specifies.

GetOccurrenceOrException(Object, Int32)

Returns an occurrence or exception under the specified recurrence index from the recurring chain which the recurrence info with the given identifier specifies.

GetOccurrencesAndExceptions(AppointmentItem, DateTimeRange)

Returns all occurrences and exceptions to the specified pattern that are within the given date-time interval.

GetOccurrencesAndExceptions(Object, DateTimeRange)

Returns all occurrences and exceptions to a pattern that use the recurrence info with the specified identifier.

Inheritance

Object
DevExpress.XamarinForms.Scheduler.Internal.NotifyPropertyChangedBase
SourceObjectContainer
AppointmentItem
See Also