Skip to main content

RecurrenceRangeControl.TimeZoneHelper Property

Provides access to the object used for date/time calculations.

Namespace: DevExpress.Xpf.Scheduler.UI

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

#Declaration

public TimeZoneHelper TimeZoneHelper { get; set; }

#Property Value

Type Description
TimeZoneHelper

A DevExpress.XtraScheduler.TimeZoneHelper class instance.

#Remarks

Use the TimeZoneHelper property to specify the time zone helper used to convert date/time values from the time zone of the current host to the client time zone of the scheduler control, and vice versa.

#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) {
    }
}
See Also