SchedulerControl.CustomAppointmentBackground Event

Allows you to customize the appointments' appearance by changing their background color.

Namespace: DevExpress.Xpf.Scheduling

Assembly: DevExpress.Xpf.Scheduling.v20.1.dll

Declaration

[Browsable(false)]
public event CustomAppointmentBackgroundEventHandler CustomAppointmentBackground
<Browsable(False)>
Public Event CustomAppointmentBackground As CustomAppointmentBackgroundEventHandler

Event Data

The CustomAppointmentBackground event's data class is CustomAppointmentBackgroundEventArgs. The following properties provide information specific to this event:

Property Description
AppointmentItem Provides access to the current appointment.
Background Gets or sets a background color for the appointment.
SourceObject Provides access to the appointments' source object.

Remarks

The CustomAppointmentBackground event is raised when the Scheduler is loaded. Handle the CustomAppointmentBackground event to change the background color of the desired appointments. Access the appointment using the CustomAppointmentBackgroundEventArgs.AppointmentItem property. Use the CustomAppointmentBackgroundEventArgs.Background property to change the background color.

Examples

Private Sub SchedulerControl_CustomAppointmentBackground(ByVal sender As Object, ByVal e As CustomAppointmentBackgroundEventArgs)
    'Change the recurrent appointments' background to blanched almond color,
    'and other appointments - to rosy brown 
    e.Background = If(e.AppointmentItem.Type = AppointmentType.Occurrence, New SolidColorBrush(Colors.BlanchedAlmond), New SolidColorBrush(Colors.RosyBrown))

    'Change all-day appointments' background:
    e.Background = If(e.AppointmentItem.AllDay = True, New SolidColorBrush(Colors.Tomato), e.Background)
End Sub
See Also