This topic contains a list of guidelines for migrating your WPF Scheduler (deprecated) project to the current WPF Scheduler control.
Project References and Namespaces
Remove reference to the DevExpress.Xpf.Scheduler.v19.2.dll assembly.
Add a reference to the DevExpress.Xpf.Scheduling.v19.2.dll assembly.
Change xmlns:dxsch="http://schemas.devexpress.com/winfx/2008/xaml/scheduler" to xmlns:dxsch="http://schemas.devexpress.com/winfx/2008/xaml/scheduling".
The Week view in the new Scheduler is similar to the former Full Week View; the former Week View has no equivalent in the new Scheduler.
All view types with default settings are available "out-of-the-box". However, in XAML you can specify any number of views with different types and settings. All views are contained in the SchedulerControl.Views collection. The active view is specified by the SchedulerControl.ActiveViewIndex property.
The ViewBase.Caption property allows the end-user to determine which menu item to click when switching views:
View properties are specified as illustrated in the following table:
The SchedulerControl.AppointmentsUpdated event fires when an appointment is changed. You can handle this event to save changes to the external data source. However, it does not provide information on modified appointments. The more versatile event is the SchedulerControl.ItemPropertyChanged event which indicates property changes and updates to appointments, resources, statuses and labels.
The SchedulerControl.GetAppointments method returns all appointments within the specified interval, including occurrences and exceptions. To get all occurrences within the specified interval (in the code sample - 5 days), use the following code:
Dim interval As New DevExpress.Mvvm.DateTimeRange(Date.Today, Date.Today.AddDays(5))
Dim occurrences As IEnumerable(Of AppointmentItem) = Me.scheduler.GetAppointments(interval).Where(Function(a) a.Type = DevExpress.XtraScheduler.AppointmentType.Occurrence)
You can assign any appointment to the recurrence chain by making it an exception the specified recurrence pattern using the AppointmentItem.SetExceptionRecurrenceIndex and AppointmentItem.SetExceptionRecurrencePattern methods. The following code snippet demonstrates how to convert an appointment with an index 2 in the Scheduler appointment collection to the exception of the pattern specified by the appointment with index 0 and exception recurrence index 3:
Dim apt As AppointmentItem = Me.scheduler.AppointmentItems(2)
apt.Type = DevExpress.XtraScheduler.AppointmentType.ChangedOccurrence
Dim pattern As AppointmentItem = Me.scheduler.AppointmentItems(0)
A ResourceItem class instance represents the Resource object. ResourceItem collections are accessible using the following members:
A resource does not contain an associated image. The legacy Scheduler has the Resource.ImageBytes property which provides a picture to display in a resource header. At this time, you should use a custom field to store and obtain an image, thus a custom field mapping is required in that situation.
To show an image (text or any control) in the resource header, create a custom template and assign it to the SchedulerViewBase.ResourceHeaderContentTemplate property. The DataContext of this template is a ResourceHeaderViewModel object that provides the Resource and Interval properties. You can use these properties in bindings inside the Resource Header data template.