Back to Devexpress

AppointmentItem.Type Property

wpf-devexpress-dot-xpf-dot-scheduling-dot-appointmentitem-d8df59fa.md

latest5.2 KB
Original Source

AppointmentItem.Type Property

Gets or sets the type of an appointment.

Namespace : DevExpress.Xpf.Scheduling

Assembly : DevExpress.Xpf.Scheduling.v25.2.dll

NuGet Package : DevExpress.Wpf.Scheduling

Declaration

csharp
public AppointmentType Type { get; set; }
vb
Public Property Type As AppointmentType

Property Value

TypeDescription
AppointmentType

An AppointmentType enumeration value which specifies the appointment’s type.

|

Available values:

NameDescription
Normal

Represents a standard (non-recurring) appointment.

| | Pattern |

Represents the appointment which serves as the pattern for the other recurring appointments. The pattern for recurring appointments is specified via the Appointment.RecurrenceInfo property.

| | Occurrence |

Represents a recurring appointment whose pattern appointment is specified via the Appointment.RecurrencePattern property.

| | ChangedOccurrence |

Represents a recurring appointment, which was changed and now doesn’t satisfy the pattern of the recurring series.

| | DeletedOccurrence |

Represents a recurring appointment which was deleted from the series of other recurring appointments of the same pattern.

|

Remarks

The type of the appointment is specified by its role (normal, recurring, modified in a recurring series (exception), etc.). All available types are listed in the AppointmentType enumeration.

You can use the Type property to change a regular appointment in a recurring series into an exception and restore an exception back to the regular occurrence.

Important

Do not change the appointment type arbitrarily. There are certain type changes which are not valid. Ensure that an appointment has all the information required for the new type, such as the correct AppointmentItem.RecurrenceInfo value for the AppointmentType.ChangedOccurrence appointment type.

The following table lists type conversions which are not valid and results in an exception:

BeforeAfter
NormalOccurrence
PatternOccurrence
OccurrencePattern

Other type conversions are valid, provided an appointment has the correct information in the required fields (AppointmentItem.RecurrenceInfo and SchedulerItemBase.RecurrenceIndex for recurring series).

The following code snippet (auto-collected from DevExpress Examples) contains a reference to the Type property.

Note

The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.

wpf-scheduler-handle-customappointmentbackground-event-to-change-appointment-background/CS/CustomAppointmentBackground/MainWindow.xaml.cs#L14

csharp
//and background of other appointments - to rosy brown:
e.Background = (e.AppointmentItem.Type == AppointmentType.Occurrence) ?
new SolidColorBrush(Colors.BlanchedAlmond) : new SolidColorBrush(Colors.RosyBrown);

wpf-scheduler-handle-customappointmentbackground-event-to-change-appointment-background/VB/CustomAppointmentBackground/MainWindow.xaml.vb#L18

vb
'and background of other appointments - to rosy brown:
e.Background = If(e.AppointmentItem.Type = AppointmentType.Occurrence, New SolidColorBrush(Colors.BlanchedAlmond), New SolidColorBrush(Colors.RosyBrown))
'Change the all-day appointment background:

See Also

AppointmentItem Class

AppointmentItem Members

DevExpress.Xpf.Scheduling Namespace