Skip to main content

ResourceItem.Color Property

Gets or sets the color associated with the resource.

Namespace: DevExpress.Xpf.Scheduling

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

NuGet Package: DevExpress.Wpf.Scheduling

Declaration

public Color Color { get; set; }

Property Value

Type Description
Color

A Color object specifying the resource color.

Remarks

Tip

The Brush property is the recommended method to assign colors to resources. The Brush property overrides the Color property. Refer to the Customize Colors topic for more information.

The 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 SchedulerControl.ResourceColors settings are ignored.

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

You can set SchedulerControl.ResourceColors directly for all themes:

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

<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 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
See Also