Skip to main content
All docs
V23.2

ApplicationThemeHelper.Preload(Func<UserControl>) Method

Preloads theme resources for the view specified by the UserControl and allows you to initialize this view before the preload.

Namespace: DevExpress.Xpf.Core

Assembly: DevExpress.Data.Desktop.v23.2.dll

NuGet Packages: DevExpress.Data.Desktop, DevExpress.ExpressApp.Win.Design

Declaration

public static void Preload(
    Func<UserControl> createAction
)

Parameters

Name Type Description
createAction Func<UserControl>

A function that initializes the preloaded UserControl.

Remarks

Use this method if the preloaded view is “lightweight” and you populate it with controls at runtime or based on a parameter.

The following code sample calls the MyControl.Populate() method and preloads resources for the MyControl after the method is executed:

using DevExpress.Xpf.Core;
using System.Windows;

public partial class App : Application {
    static App() {
        SplashScreenManager.CreateThemed().ShowOnStartup();
        ApplicationThemeHelper.Preload(() => new MyControl().Populate());
    }
}

Refer to the following help topic for more information: Preload Theme Resources.

See Also