Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.
How to: Create a Custom Appointment Recurrence Form (legacy)
4 minutes to read
Note
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.
This document describes how to create a custom appointment recurrence editing form using recurrence controls provided by DXScheduler for the WPF Suite and use this form instead of the default one. The default Edit Appointment form is remained unchanged in this example.
Create a custom appointment recurrence editing form that allows end-users to set an appointment recurrence range. To do this, add a new User Control (under the CustomRecurrenceForm.xaml name) to the WpfApplication1 project. Locate the RecurrenceRangeControl and two Button (OK and Cancel) controls on this form.
ImportsMicrosoft.VisualBasicImportsSystemImportsSystem.WindowsImportsSystem.Windows.ControlsImportsDevExpress.XtraSchedulerImportsDevExpress.Xpf.SchedulerImportsDevExpress.Xpf.Scheduler.UIPublicClass CustomRecurrenceForm
PublicSubNew(ByVal controller As AppointmentFormController)
RecurrenceVisualController = New StandaloneRecurrenceVisualController(controller)
controller = controller
InitializeComponent()
EndSubPrivate privateController As AppointmentFormController
PublicProperty Controller() As AppointmentFormController
GetReturn privateController
EndGetPrivateSet(ByVal value As AppointmentFormController)
privateController = value
EndSetEndPropertyPrivate privateRecurrenceVisualController As StandaloneRecurrenceVisualController
PublicProperty RecurrenceVisualController() As StandaloneRecurrenceVisualController
GetReturn privateRecurrenceVisualController
EndGetPrivateSet(ByVal value As StandaloneRecurrenceVisualController)
privateRecurrenceVisualController = value
EndSetEndPropertyPublicReadOnlyProperty TimeZoneHelper() As TimeZoneHelper
GetReturn RecurrenceVisualController.Controller.TimeZoneHelper
EndGetEndPropertyPrivateSub UserControl_Loaded(sender AsObject, e As RoutedEventArgs)
SchedulerFormBehavior.SetTitle(Me, "Recurrence Range")
EndSubPrivateSub OK_Click(sender AsObject, e As RoutedEventArgs)
RecurrenceVisualController.ApplyRecurrence()
CloseForm(True)
EndSubPrivateSub Cancel_Click(sender AsObject, e As RoutedEventArgs)
CloseForm(False)
EndSubPrivateSub CloseForm(ByVal dialogResult AsBoolean)
SchedulerFormBehavior.Close(Me, dialogResult)
EndSubEndClass
privatevoidschedulerControl1_RecurrenceFormShowing(object sender, RecurrenceFormEventArgs e) {
AppointmentForm appointmentForm = e.ParentForm as AppointmentForm;
e.Form = new CustomRecurrenceForm(appointmentForm.Controller);
}
PrivateSub schedulerControl1_RecurrenceFormShowing(sender AsObject, _
e As RecurrenceFormEventArgs)
Dim appointmentForm As AppointmentForm = TryCast(e.ParentForm, AppointmentForm)
e.Form = New CustomRecurrenceForm(appointmentForm.Controller)
EndSub
Run the project. The custom appointment recurrence editing form will be invoked when selecting New Recurring Appointment or New Recurring Event from the context menu, selecting Edit Series from the recurring appointment context menu or clicking the Recurrence button on the default appointment editing form.