Skip to main content
A newer version of this page is available. .

Theme.CachePaletteThemes Property

Gets or sets whether to cache the current palette theme assembly. This is a dependency property.

Namespace: DevExpress.Xpf.Core

Assembly: DevExpress.Xpf.Core.v19.2.dll

Declaration

public static bool CachePaletteThemes { get; set; }

Property Value

Type Description
Boolean

true, to cache the current palette theme assembly; otherwise, false.

Remarks

You can cache the current palette theme’s assembly to reduce the theme loading time. The application uses the cached assemblies at the current and the following application runs.

Specify the Cache Location

Use the Theme.PaletteThemeCacheDirectory property to specify the cache directory. The default cache directory is %LocalAppData%\DevExpress\PaletteThemeCache. The following code sample changes the default cache directory:

Theme.PaletteThemeCacheDirectory = "C:\\DevExpress\\PaletteThemeCache";

Clear the Cache

To remove the directory with the cached assemblies, use the Theme.ClearPaletteThemeCache method:

Theme.ClearPaletteThemeCache();

Example

The following code sample enables the palette theme assemblies caching to a default directory and applies the Office2019Colorful theme with the RedWine predefined palette to the application:

Theme.CachePaletteThemes = true;
Theme.RegisterPredefinedPaletteThemes();
ApplicationThemeHelper.ApplicationThemeName = "RedWineOffice2019Colorful";
See Also