A newer version of this page is available. Switch to the current version.

TimelineView.TimeScales Property

Provides access to a collection of time scales available in the Timeline View. This is a dependency property.

Namespace: DevExpress.Xpf.Scheduling

Assembly: DevExpress.Xpf.Scheduling.v18.2.dll

Declaration

[Browsable(false)]
public TimeScaleCollection TimeScales { get; set; }
<Browsable(False)>
Public Property TimeScales As TimeScaleCollection

Property Value

Type Description
TimeScaleCollection

A collection containing time scales for the Timeline view.

Remarks

Use the TimeScales property to get access to the collection that stores all time scales of the current Timeline View. An individual item in the collection is represented by the TimeScaleBase class descendant. Use the collection's methods and properties to add, modify or remove time scales. The available time scales are used in the visible time interval calculations, and you may control whether a particular time scale should be considered using the scale's IsEnabled property.

The default TimeScaleCollection contains the following items:

Scale Type Description IsEnabled
TimeScaleYear A time scale whose time cell value is equal to a single year. false
TimeScaleQuarter A time scale whose time cell value is equal to a quarter of a year. false
TimeScaleMonth A time scale whose time cell value is equal to a single month. false
TimeScaleWeek A time scale whose time cell value is equal to a single week. true
TimeScaleDay A time scale whose time cell value is equal to a single day. true
TimeScaleHour A time scale whose time cell value is equal to a single hour. false
TimeScaleWorkHour A time scale whose time cell value is equal to a working hour. false

The following picture shows default time scale items in the pop-up menu.

WPFScheduler_Timeline_TimeScales

TIP

You can implement a custom fixed scale using the FixedTimeScale class instance. Specify a custom interval by setting the FixedTimeScale.Scale property.

The following example demonstrates how to specify a custom set of time scales for the Timeline View:

<dxsch:TimelineView x:Name="timelineView" IntervalCount="8">
    <dxsch:TimelineView.TimeScales>
        <dxsch:TimeScaleWeek x:Name="scaleWeek" IsEnabled="False"/>
        <dxsch:TimeScaleWorkDay x:Name="scaleWorkDay" IsEnabled="True"/>
        <dxsch:TimeScaleWorkHour x:Name="scaleWorkHour" IsEnabled="True"/>
        <dxsch:FixedTimeScale x:Name="scaleFixedTime" Caption ="30 minutes" Scale="00:30:00" IsEnabled="True" ShowHeaders="False"/>
    </dxsch:TimelineView.TimeScales>
</dxsch:TimelineView>

The Timeline View also supports binding to a collection of objects containing time scale settings, described in a Model or ViewModel. See the TimelineView.TimeScalesSource, TimelineView.TimeScaleTemplate and TimelineView.TimeScaleTemplateSelector property descriptions to learn more about this approach.

See Also