Back to Devexpress

Theme.CachePaletteThemes Property

wpf-devexpress-dot-xpf-dot-core-dot-theme-a1673b9a.md

latest3.1 KB
Original Source

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.v25.2.dll

NuGet Package : DevExpress.Wpf.Core

Declaration

csharp
public static bool CachePaletteThemes { get; set; }
vb
Public Shared Property CachePaletteThemes As Boolean

Property Value

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

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

Clear the Cache

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

csharp
Theme.ClearPaletteThemeCache();
vb
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:

csharp
Theme.CachePaletteThemes = true;
Theme.RegisterPredefinedPaletteThemes();
ApplicationThemeHelper.ApplicationThemeName = "RedWineOffice2019Colorful";
vb
Theme.CachePaletteThemes = True
Theme.RegisterPredefinedPaletteThemes()
ApplicationThemeHelper.ApplicationThemeName = "RedWineOffice2019Colorful"

See Also

PaletteThemeCacheDirectory

ClearPaletteThemeCache()

Theme Class

Theme Members

DevExpress.Xpf.Core Namespace