Skip to main content

How to: Manually Invoke DXSplashScreen

Note

You are viewing documentation for the legacy DXSplashScreen. We recommend that you use the Splash Screen Manager or the SplashScreenManagerService to add the splash screen functionality to your applications.

After DXSplashScreen has been added to your project, you need to invoke it on the application startup. It can be invoked either automatically or manually.

Invoking DXSplashScreen Manually

You can also manually control when to display and hide DXSplashScreen. This can be accomplished by calling static methods provided by the DXSplashScreen class.

For instance, the following code opens a splash screen on the application startup.

using DevExpress.Xpf.Core;

namespace WpfApplication1 {
    public partial class App : Application {
        protected override void OnStartup(StartupEventArgs e) {
            base.OnStartup(e);
            DXSplashScreen.Show<SplashScreenView1>();
        }
    }
}

The following code closes the opened splash screen when the main window is initialized.

using DevExpress.Xpf.Core;

namespace WpfApplication1 {
    public partial class MainWindow : Window {
        public MainWindow() {
            InitializeComponent();
            this.Loaded += new RoutedEventHandler(MainWindow_Loaded);
        }

        void MainWindow_Loaded(object sender, RoutedEventArgs e) {
            DXSplashScreen.Close();
            this.Activate();
        }
    }
}
See Also