A newer version of this page is available. Switch to the current version.

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.

WPFScheduler_Label_As

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
AppointmentLabel.None System.Windows.Media.Colors.Transparent SchedulerStringId.AppointmentLabel_None 0
AppointmentLabel.Important #FFFFC2BE SchedulerStringId.AppointmentLabel_Important 1
AppointmentLabel.Business #FFA8D5FF SchedulerStringId.AppointmentLabel_Business 2
AppointmentLabel.Personal #FFC1F49C SchedulerStringId.AppointmentLabel_Personal 3
AppointmentLabel.Vacation #FFF3E4C7 SchedulerStringId.AppointmentLabel_Vacation 4
AppointmentLabel.MustAttend #FFF4CE93 SchedulerStringId.AppointmentLabel_MustAttend 5
AppointmentLabel.TravelRequired #FFC7F4FF SchedulerStringId.AppointmentLabel_TravelRequired 6
AppointmentLabel.NeedsPreparation #FFCFDB98 SchedulerStringId.AppointmentLabel_NeedsPreparation 7
AppointmentLabel.Birthday #FFE0CFE9 SchedulerStringId.AppointmentLabel_Birthday 8
AppointmentLabel.Anniversary #FF8DE9DF SchedulerStringId.AppointmentLabel_Anniversary 9
AppointmentLabel.PhoneCall #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.

See Also