title: WPF splashscreen active when form is loaded
body: <p>I'm using a splashscreen with the following code:</p>
  
  <pre><code>var splashScreen = new SplashScreen("/Resources/enetricity.png");
          splashScreen.Show(false);
  
          InitializeComponent();
          DataContext = viewModel; 
  
          // pump until loaded
          PumpDispatcherUntilPriority(DispatcherPriority.Loaded);
  
          // start a timer, after which the splash can be closed
          var splashTimer = new DispatcherTimer
          {
              Interval = TimeSpan.FromSeconds(2)
          };
          splashTimer.Tick += (s, e) =&gt;
          {
              splashTimer.Stop();
              splashScreen.Close(splashTimer.Interval);               
  
          };
  
          splashTimer.Start();
  
  private static void PumpDispatcherUntilPriority(DispatcherPriority dispatcherPriority)
      {
          var dispatcherFrame = new DispatcherFrame();
          Dispatcher.CurrentDispatcher.BeginInvoke((ThreadStart)(() =&gt; dispatcherFrame.Continue = false), dispatcherPriority);
          Dispatcher.PushFrame(dispatcherFrame);
      }
  </code></pre>
  
  <p>But this is what happens: the splashscreen shows up, then the window shows up and the splashscreen is back, and then after some time its gone. The timer is good, when the splashscreen the second time is gone, all modules and UI are loaded. But I don't want to see my window already.. So it should only show up once</p>
  
  <p>Greets</p>