Labels
- 2 minutes to read
Overview
A label is an object that is used to categorize appointments. It provides a caption and a color, so that end-users can assign a corresponding color to an appointment’s background to identify appointments.
The image below shows appointments with different labels. An end-user can change the appointment’s label in the context menu.
A label is an AppointmentLabelItem class instance that is assigned to an appointment using the AppointmentItem.LabelId property. All labels are contained in the SchedulerControl.LabelItems collection and you can use it to customize existing labels, remove them or add your own.
Default Labels
The SchedulerControl.LabelItems collection includes the following labels by default:
Color | Color Value | Display Name | LabelId |
---|---|---|---|
System.Windows.Media.Color.White | SchedulerStringId.AppointmentLabel_None | 0 | |
#FFFFC2BE | SchedulerStringId.AppointmentLabel_Important | 1 | |
#FFA8D5FF | SchedulerStringId.AppointmentLabel_Business | 2 | |
#FFC1F49C | SchedulerStringId.AppointmentLabel_Personal | 3 | |
#FFF3E4C7 | SchedulerStringId.AppointmentLabel_Vacation | 4 | |
#FFF4CE93 | SchedulerStringId.AppointmentLabel_MustAttend | 5 | |
#FFC7F4FF | SchedulerStringId.AppointmentLabel_TravelRequired | 6 | |
#FFCFDB98 | SchedulerStringId.AppointmentLabel_NeedsPreparation | 7 | |
#FFE0CFE9 | SchedulerStringId.AppointmentLabel_Birthday | 8 | |
#FF8DE9DF | SchedulerStringId.AppointmentLabel_Anniversary | 9 | |
#FFFFF7A5 | SchedulerStringId.AppointmentLabel_PhoneCall | 10 |
Label colors are defined in the DevExpress WPF Theme resources using the theme key SchedulerThemeKey and ResourceKey=LabelColors. Different themes can have different label colors. Label colors are available using the SchedulerControl.LabelColors property.
Tip
Handle the SchedulerControl.InitNewAppointment event to initialize all newly created appointments with a specific label.
Binding to Data
Labels can be bound to a data source using the DataSource.AppointmentLabelsSource property. Map data fields to label properties using the AppointmentLabelMappings settings.