0

I am trying to use the SplashScreenService to show the user the progress of starting the application. Within the tasks I am creating the logger, the container, configuring the container, creating and initializing my MainWindow (View+ViewModel) and so on ... the tasks of a bootstrapper.

But the SplashScreenService refuses his work when committing because of Application.Current.MainWindow == null. The thing is that Application.Current.MainWindow is set within the initalization task. I could workaround this with temporaly setting Application.Current.MainWindow = new Window() before the splashScreenService.Commit() and fixing the issue with MainWindow gets closed after SplashScreen is closed by setting the owner to null of my MainWindow (the owner was set to the PleaseWait dialog which therefor also closes the MainWindow).

So why must the Application.Current.MainWindow be set to get the SplashScreenService working? Within the service there is no code that uses this property. And I can only create my MainWindow after all other tasks are completed - a real chicken-and-egg problem!

Community
  • 1
  • 1

0 Answers0