DayView.VerticalAppointmentContentTemplate Property
Gets or sets the template that defines the visual content of appointments displayed vertically in the Day and Work-Week views.
Namespace: DevExpress.Xpf.Scheduler
Assembly: DevExpress.Xpf.Scheduler.v18.2.dll
Declaration
Property Value
Type | Description |
---|---|
DataTemplate | A DataTemplate object that defines the content of appointments. |
Remarks
Important
You are viewing documentation for the legacy WPF Scheduler control. If you’re starting a new project, we strongly recommend that you use a new control declared in the DevExpress.Xpf.Scheduling namespace. If you decide to upgrade an existing project in order to switch to the updated scheduler control, see the Migration Guidelines document.
The templates supplied by the DXScheduler allow you to completely replace the look and feel of visual elements, while maintaining their existing behavior.
The binding source for the VerticalAppointmentContentTemplate template is represented by the VisualVerticalAppointmentControl class.
To learn more, see Styles and Templates.
Example
This example demonstrates how to use the DayView.VerticalAppointmentContentTemplate
property to apply a custom template to appointments displayed vertically in the Day View and Work-Week View.
Note
A complete sample project is available at https://github.com/DevExpress-Examples/how-to-apply-a-custom-template-to-appointments-in-day-or-work-week-view-e3008.
using System;
using System.Windows;
using DevExpress.Xpf.Scheduler;
using DevExpress.XtraScheduler;
namespace WpfApplication1 {
public partial class MainWindow : Window {
public MainWindow() {
InitializeComponent();
SchedulerStorage schedulerStorage = schedulerControl1.Storage;
Appointment apt = schedulerStorage.CreateAppointment(AppointmentType.Normal);
DateTime baseTime = DateTime.Today;
apt.Start = baseTime.AddHours(1);
apt.End = baseTime.AddHours(3.5);
apt.Subject = "Appointment Subject";
apt.Location = "Appointment Location";
apt.Description = "Appointment description";
schedulerStorage.AppointmentStorage.Add(apt);
schedulerControl1.Start = apt.Start.Date;
schedulerControl1.ActiveView.SelectAppointment(apt);
}
}
}
Related GitHub Examples
The following code snippet (auto-collected from DevExpress Examples) contains a reference to the VerticalAppointmentContentTemplate 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.