WPF - Splash screen with status update

When your WPF application start up, there are times when it need to load some data or doing some long running task before your application window is fully loaded. So, splash screen is added to make it feel more responsive, but it is still not enough, some application may take a few task to run before loading the window. Most user will feel the application is hanging on splash screen and won't loads. So i thought adding a status update to the splash screen. Each completed task will update this status label.

This splash screen is actually a window control with windowstyle set to none and other properties set. You can add your splash image inside and set splash screen resolution to be the same with the image resolution. I posted the solution here.

To show the splash screen, you need to fire the event on startup. Then call Splash.BeginDisplay();.

<Application x:Class="SplashScreenWithStatus.App"
    StartupUri="Window1.xaml" Startup="Application_Startup">

private void Application_Startup(object sender, StartupEventArgs e)

Then you need to call Splash.EndDisplay(); after you application's main window is loaded. I added Thread.Sleep(..); to simulate a long running task and update the status label accordingly when initializing component.


Anonymous said...

threading would make it even better

Post a Comment