Skip to main content
A newer version of this page is available. .

RecurrenceRangeControl Class

A control used to specify an end condition for the series of recurring appointments.

Namespace: DevExpress.Xpf.Scheduler.UI

Assembly: DevExpress.Xpf.Scheduler.v21.2.dll

NuGet Package: DevExpress.Wpf.Scheduler

Declaration

public class RecurrenceRangeControl :
    UserControl,
    INotifyPropertyChanged,
    IComponentConnector

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 control is used to set the RecurrenceInfo.Range value for the recurrence series.

The control looks as illustrated in the image below.

DXScheduler_RecurrenceRangeControl_EndAfter

To bind the RecurrenceRangeControl control to the recurrence range setting of the pattern appointment, use its RecurrenceRangeControl.RecurrenceInfo and RecurrenceRangeControl.Pattern properties.

Refer to How to: Create a Custom Appointment Recurrence Form (legacy) for an example on how to use the RecurrenceRangeControl control on a custom appointment recurrence editing form.

Example

This example demonstrates how to use the RecurrenceRangeControl control on a custom Edit Appointment form, to modify 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.

To get an example with step-by-step instructions on how to replace a standard Edit Appointment form with a custom one, refer to the Lesson 9 - Create a Custom Edit Appointment Form (legacy) document.

using System;
using System.Windows;
using System.Windows.Controls;
using DevExpress.Xpf.Scheduler;
using DevExpress.XtraScheduler;
using DevExpress.Xpf.Scheduler.UI;

namespace WpfApplication1 {

    public partial class CustomAppointmentForm : UserControl {

        SchedulerControl control;
        CustomAppointmentFormController controller;
        RecurrenceVisualController recurrenceVisualController;

        public CustomAppointmentForm(SchedulerControl control, Appointment apt) {
            InitializeComponent();

            if (control == null || apt == null)
                throw new ArgumentNullException("control");
            if (control == null || apt == null)
                throw new ArgumentNullException("apt");

            this.control = control;
            this.controller = new CustomAppointmentFormController(control, apt);
            this.recurrenceVisualController = new RecurrenceVisualController(controller);
        }

        public SchedulerControl Control { get { return control; } }
        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) {
        }
    }
See Also