Skip to main content
All docs
V25.1
  • ApplicationThemeHelper.PreloadAsync(PreloadCategories[]) Method

    Asynchronously preloads theme resources for the specified controls.

    Namespace: DevExpress.Xpf.Core

    Assembly: DevExpress.Xpf.Core.v25.1.dll

    NuGet Package: DevExpress.Wpf.Core

    Declaration

    public static Task PreloadAsync(
        params PreloadCategories[] preloadCategories
    )

    Parameters

    Name Type Description
    preloadCategories PreloadCategories[]

    A collection of DevExpress WPF controls.

    Returns

    Type Description
    Task

    A task that allows you to asynchronously preload theme resources.

    Remarks

    Note

    The PreloadAsync method allows you to preload lightweight theme resources only. Use the PreloadThemeResourceAsync method instead to asynchronously preload regular theme resources.

    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