Skip to main content

CalendarClient.IntervalFactories Property

Gets or sets a collection of IntervalFactory descendants. The objects in this collection define the available time intervals and formatting rules applied to them. Time intervals are visually represented by the calendar items.

Namespace: DevExpress.Xpf.Editors.RangeControl

Assembly: DevExpress.Xpf.Core.v24.1.dll

NuGet Package: DevExpress.Wpf.Core

Declaration

public ObservableCollection<IntervalFactory> IntervalFactories { get; set; }

Property Value

Type Description
ObservableCollection<DevExpress.Xpf.Editors.RangeControl.IntervalFactory>

A collection of factory objects that define the available calendar items.

Remarks

Use the IntervalFactories property to specify the time intervals that the CalendarClient items can display. The following intervals are available:

  • YearIntervalFactory
  • QuarterIntervalFactory
  • MonthIntervalFactory
  • DayIntervalFactory
  • HourIntervalFactory
  • MinuteIntervalFactory
  • SecondIntervalFactory

The following example demonstrates how to configure a calendar client using the IntervalFactory objects:

CalendarClient Interval Factories

<dxe:RangeControl>
    <dxe:CalendarClient AllowGrouping="False">
        <dxe:CalendarClient.IntervalFactories>
            <dxe:MonthIntervalFactory/>
            <dxe:DayIntervalFactory/>
            <dxe:HourIntervalFactory/>
        </dxe:CalendarClient.IntervalFactories>
    </dxe:CalendarClient>
</dxe:RangeControl>

Each interval factory includes the following properties:

  • ShortTextFormat
  • TextFormat
  • LongTextFormat
  • LongestTextFormat

These properties allow you to format interval captions based on the zoom level.

<dxe:MonthIntervalFactory ShortTextFormat="{}{0:M}"
                          TextFormat="{}{0:MMM}"
                          LongTextFormat="{}{0:MMMM}, {0:yyyy}"/>

The QuarterIntervalFactory allows you to format two values. The first value is the quarter number. The second value is the DateTime value (the same as in other interval factories).

<dxe:QuarterIntervalFactory ShortTextFormat="{}Q{0}, {1:yy}"
                            TextFormat="{}Q{0}, {1:yyyy}"
                            LongTextFormat="{}Q{0}, {1:yyyy}"/>

Refer to the following topics for more information: Standard Date and Time Format Strings, Custom Date and Time Format Strings.

See Also