ApplicationThemeHelper.PreloadAsync(PreloadCategories[]) Method
In This Article
Asynchronously preloads theme resources for the specified controls.
Namespace: DevExpress.Xpf.Core
Assembly: DevExpress.Xpf.Core.v24.2.dll
NuGet Package: DevExpress.Wpf.Core
#Declaration
public static Task PreloadAsync(
params PreloadCategories[] preloadCategories
)
#Parameters
Name | Type | Description |
---|---|---|
preload |
Preload |
A collection of DevExpress WPF controls. |
#Returns
Type | Description |
---|---|
Task | A task that allows you to asynchronously preload theme resources. |
#Remarks
Note
The Preload
method allows you to preload lightweight theme resources only. Use the Preload
The following code sample asynchronously preloads Data Grid and Layout Control theme resources:
using DevExpress.Xpf.Core;
using System.Windows;
public partial class App : Application {
static App() {
CompatibilitySettings.UseLightweightThemes = true;
}
protected override async void OnStartup(StartupEventArgs e) {
base.OnStartup(e);
await ApplicationThemeHelper.PreloadAsync(PreloadCategories.Grid, PreloadCategories.LayoutControl);
}
}
Refer to the following help topic for more information: Preload Theme Resources.
See Also