Skip to main content

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 or the Appointment Window.

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:

<dxsch:SchedulerControl.LabelItems>
    <dxsch:AppointmentLabelItem BrushName="{x:Static dxsch:DefaultBrushNames.LabelNone}" Caption="{dxsch:SchedulerLocalizer StringId=AppointmentLabel_None}" Id="{x:Static dxsch:DefaultItemIds.LabelNone}"/>
    <dxsch:AppointmentLabelItem BrushName="{x:Static dxsch:DefaultBrushNames.LabelImportant}" Caption="{dxsch:SchedulerLocalizer StringId=AppointmentLabel_Important}" Id="{x:Static dxsch:DefaultItemIds.LabelImportant}"/>
    <dxsch:AppointmentLabelItem BrushName="{x:Static dxsch:DefaultBrushNames.LabelBusiness}" Caption="{dxsch:SchedulerLocalizer StringId=AppointmentLabel_Business}" Id="{x:Static dxsch:DefaultItemIds.LabelBusiness}"/>
    <dxsch:AppointmentLabelItem BrushName="{x:Static dxsch:DefaultBrushNames.LabelPersonal}" Caption="{dxsch:SchedulerLocalizer StringId=AppointmentLabel_Personal}" Id="{x:Static dxsch:DefaultItemIds.LabelPersonal}"/>
    <dxsch:AppointmentLabelItem BrushName="{x:Static dxsch:DefaultBrushNames.LabelVacation}" Caption="{dxsch:SchedulerLocalizer StringId=AppointmentLabel_Vacation}" Id="{x:Static dxsch:DefaultItemIds.LabelVacation}"/>
    <dxsch:AppointmentLabelItem BrushName="{x:Static dxsch:DefaultBrushNames.LabelMustAttend}" Caption="{dxsch:SchedulerLocalizer StringId=AppointmentLabel_MustAttend}" Id="{x:Static dxsch:DefaultItemIds.LabelMustAttend}"/>
    <dxsch:AppointmentLabelItem BrushName="{x:Static dxsch:DefaultBrushNames.LabelTravelRequired}" Caption="{dxsch:SchedulerLocalizer StringId=AppointmentLabel_TravelRequired}" Id="{x:Static dxsch:DefaultItemIds.LabelTravelRequired}"/>
    <dxsch:AppointmentLabelItem BrushName="{x:Static dxsch:DefaultBrushNames.LabelNeedsPreparation}" Caption="{dxsch:SchedulerLocalizer StringId=AppointmentLabel_NeedsPreparation}" Id="{x:Static dxsch:DefaultItemIds.LabelNeedsPreparation}"/>
    <dxsch:AppointmentLabelItem BrushName="{x:Static dxsch:DefaultBrushNames.LabelBirthday}" Caption="{dxsch:SchedulerLocalizer StringId=AppointmentLabel_Birthday}" Id="{x:Static dxsch:DefaultItemIds.LabelBirthday}"/>
    <dxsch:AppointmentLabelItem BrushName="{x:Static dxsch:DefaultBrushNames.LabelAnniversary}" Caption="{dxsch:SchedulerLocalizer StringId=AppointmentLabel_Anniversary}" Id="{x:Static dxsch:DefaultItemIds.LabelAnniversary}"/>
    <dxsch:AppointmentLabelItem BrushName="{x:Static dxsch:DefaultBrushNames.LabelPhoneCall}" Caption="{dxsch:SchedulerLocalizer StringId=AppointmentLabel_PhoneCall}" Id="{x:Static dxsch:DefaultItemIds.LabelPhoneCall}"/>
</dxsch:SchedulerControl.LabelItems>

You can generate this XAML snippet by clicking the Create Label Items item in the scheduler’s Smart Tag.

See the Appearance Customization topic for information on how to customize brushes associated with labels.

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