Back to Devexpress

CalendarClient.IntervalFactories Property

wpf-devexpress-dot-xpf-dot-editors-dot-rangecontrol-dot-calendarclient.md

latest3.7 KB
Original Source

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.v25.2.dll

NuGet Package : DevExpress.Wpf.Core

Declaration

csharp
public ObservableCollection<IntervalFactory> IntervalFactories { get; set; }
vb
Public Property IntervalFactories As ObservableCollection(Of IntervalFactory)

Property Value

TypeDescription
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:

xaml
<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.

xaml
<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).

xaml
<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

CalendarClient Class

CalendarClient Members

DevExpress.Xpf.Editors.RangeControl Namespace