ApplicationThemeHelper.PreloadAsync<T>() Method
In This Article
Asynchronously preloads theme resources for the view specified by the UserControl.
Namespace: DevExpress.Xpf.Core
Assembly: DevExpress.Xpf.Core.v24.2.dll
NuGet Package: DevExpress.Wpf.Core
#Declaration
#Type Parameters
Name | Description |
---|---|
T | A User |
#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 resources for the MyControl:
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<MyControl>();
}
}
Refer to the following help topic for more information: Preload Theme Resources.
See Also