Back to Devexpress

WorkdayRule Class

wpf-devexpress-dot-xpf-dot-gantt-31577c7e.md

latest2.4 KB
Original Source

WorkdayRule Class

Represents a working and nonworking day rule.

Namespace : DevExpress.Xpf.Gantt

Assembly : DevExpress.Xpf.Gantt.v25.2.dll

NuGet Package : DevExpress.Wpf.Gantt

Declaration

csharp
public sealed class WorkdayRule :
    Freezable<WorkdayRule>
vb
Public NotInheritable Class WorkdayRule
    Inherits Freezable(Of WorkdayRule)

Remarks

Use the WorkdayRule object to define rules related to working days. Add the WorkdayRule objects to the WorkdayRuleCollection and pass the collection to the GanttView.WorkdayRules property.

Example

xaml
<dxgn:GanttControl ItemsSource="{Binding Tasks}">
    <dxgn:GanttControl.View>
        <dxgn:GanttView
            NonworkingDayDisplayMode="Show"
            NonworkingTimeDisplayMode="Show">
            <dxgn:GanttView.WorkdayRules>
                <!-- Applies to every Friday -->
                <dxgn:WorkdayRule IsWorkday="False" Recurrence="{dxgn:Weekly DayOfWeek=Friday}" />
                <!-- Applies to every second Saturday -->
                <dxgn:WorkdayRule IsWorkday="False" Recurrence="{dxgn:Weekly DayOfWeek=Saturday, Interval=2}" />
            </dxgn:GanttView.WorkdayRules>
        </dxgn:GanttView>
    </dxgn:GanttControl.View>
</dxgn:GanttControl>

Inheritance

Object DispatcherObject DependencyObject Freezable DevExpress.Mvvm.UI.Native.Freezable<WorkdayRule> WorkdayRule

See Also

WorkdayRule Members

WorkdayRules

WorkingTimeRules

DevExpress.Xpf.Gantt Namespace