RecurrenceRangeControl.Pattern Property
Gets or sets the copy of the pattern appointment.
Namespace: DevExpress.Xpf.Scheduler.UI
Assembly: DevExpress.Xpf.Scheduler.v14.2.dll
#Declaration
#Property Value
Type | Description |
---|---|
Appointment | An Appointment object specifying a copy of the recurrence pattern. |
#Remarks
Use the Pattern property to specify the copy of the recurrence pattern required to access additional information for filling the RecurrenceRangeControl editors (for example, to access the recurrence end date to be displayed in the End by editor).
#Examples
This example demonstrates how to use the RecurrenceRangeControl control on a custom Edit Appointment form to modify the recurrence range of the pattern appointment. To bind the RecurrenceRangeControl control to the recurrence range settings via the RecurrenceVisualController and AppointmentFormController controllers, use the RecurrenceRangeControl.RecurrenceInfo and RecurrenceRangeControl.Pattern properties.
For an example with step-by-step instructions on how to replace a standard Edit Appointment form with a custom one, refer to the Lesson 3 - Create a Custom Edit Appointment Form with Custom Fields document.
using System;
using System.Windows;
using System.Windows.Controls;
using DevExpress.Xpf.Scheduler;
using DevExpress.XtraScheduler;
using DevExpress.Xpf.Scheduler.UI;
namespace SilverlightApplication1 {
public partial class CustomAppointmentForm : UserControl {
SchedulerControl control;
Appointment apt;
CustomAppointmentFormController controller;
RecurrenceVisualController recurrenceVisualController;
public CustomAppointmentForm(SchedulerControl control, Appointment apt) {
this.control = control;
this.apt = apt;
this.controller = new CustomAppointmentFormController(control, apt);
this.recurrenceVisualController = new RecurrenceVisualController(controller);
InitializeComponent();
}
public SchedulerControl Control { get { return control; } }
public Appointment Appointment { get { return apt; } }
public CustomAppointmentFormController Controller { get { return controller; } }
public RecurrenceVisualController RecurrenceVisualController
{ get { return recurrenceVisualController; } }
public TimeZoneHelper TimeZoneHelper { get { return Controller.TimeZoneHelper; } }
public bool ShouldShowRecurrence { get { return Appointment.Type == AppointmentType.Pattern
&& Controller.ShouldShowRecurrenceButton; } }
private void Ok_button_Click(object sender, RoutedEventArgs e) {
if (ShouldShowRecurrence)
RecurrenceVisualController.ApplyRecurrence();
Controller.ApplyChanges();
SchedulerFormBehavior.Close(this, true);
}
}
}
public class CustomAppointmentFormController : AppointmentFormController {
public CustomAppointmentFormController(SchedulerControl control, Appointment apt)
: base(control, apt) {
}
}