Skip to main content
All docs
V24.2

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

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.Xpf.Core.v24.2.dll

NuGet Package: DevExpress.Wpf.Core

#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