Back to Devexpress

SchedulerControl.ResourceColors Property

wpf-devexpress-dot-xpf-dot-scheduling-dot-schedulercontrol-efc42a44.md

latest3.8 KB
Original Source

SchedulerControl.ResourceColors Property

Specifies the collection of resource colors. This is a dependency property.

Namespace : DevExpress.Xpf.Scheduling

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

NuGet Package : DevExpress.Wpf.Scheduling

Declaration

csharp
[Browsable(false)]
public ColorCollection ResourceColors { get; set; }
vb
<Browsable(False)>
Public Property ResourceColors As ColorCollection

Property Value

TypeDescription
DevExpress.Xpf.Scheduling.ColorCollection

A collection of resource colors.

|

Remarks

The ResourceItem.Color property defines the resource color and has the highest priority. If you set this property (either directly or by mapping), the SchedulerControl.ResourceBrushSchemas and ResourceColors settings are ignored.

If you do not use the ResourceItem.Color property, the Scheduler takes a resource item color from the ResourceColors property.

You can set ResourceColors directly for all themes:

xaml
<dxsch:SchedulerControl.ResourceColors>
    <Color>Red</Color>
    <Color>Green</Color>
</dxsch:SchedulerControl.ResourceColors>

An alternative approach is to override the ResourceColors palette for a certain theme. To do this, use the DevExpress.Xpf.Scheduling.Themes.SchedulerThemeKeys.ResourceColors and DevExpress.Xpf.Scheduling.Themes.SchedulerThemeKeys.ResourceColors_Classic resource keys. The DevExpress.Xpf.Scheduling.Themes.SchedulerThemeKeys.ResourceColors_Classic resource key is only used in the Classic scheduler appearance style:

xaml
<dxsch:ColorCollection x:Key="{dxscht:SchedulerThemeKey ResourceKey=ResourceColors, ThemeName=Office2019Colorful}">
    <Color>Red</Color>
    <Color>Green</Color>
</dxsch:ColorCollection>

If you customized BrushSchema or SchedulerControl.ResourceBrushSchemas, it will work in the themes listed below. If the Classic mode is enabled, it will work in all themes.

  • Office2019 (White, DarkGray, Colorful, Black)
  • VisualStudio2017 (Light, Dark, Blue)
  • Office2016SE (White, DarkGray, Colorful, Black)
  • Metropolis (Light, Dark)
  • DeepBlue

The following code snippet (auto-collected from DevExpress Examples) contains a reference to the ResourceColors property.

Note

The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.

wpf-scheduler-specify-custom-work-time-intervals/CS/CustomWorkTimeExample/MainWindow.xaml#L31

xml
GroupType="Resource"
                    ResourceColors="{StaticResource MyResourceColors}">
<dxsch:SchedulerControl.ResourceItems>

See Also

SchedulerControl Class

SchedulerControl Members

DevExpress.Xpf.Scheduling Namespace