title: Dispatcher.CurrentDispatcher returns null
body: <p>I'm trying to close a WPF window I created in a separate thread from the main hosting thread (The main thread is of a PDM application that I have no control over). The host application references my assembly (it's a plugin). <strong>I don't know but why the Dispatcher is always null</strong>. Creating the WaitView on the host application is not an option for me. </p>
  
  <p>Thanks guys!</p>
  
  <pre><code>    var WaitViewModel = new MVVM.ViewModels.WaitViewModel();
                          MVVM.Views.WaitView WaitView = default(MVVM.Views.WaitView);
                          Dispatcher dispatcher = default(Dispatcher); 
                          var thread = new Thread(new ThreadStart(() =&gt;
                          {
                              dispatcher = Dispatcher.CurrentDispatcher; 
                              WaitView = new MVVM.Views.WaitView();
                              WaitView.Topmost = true;
                              WaitView.WindowStartupLocation = WindowStartupLocation.CenterScreen;
                              WaitView.DataContext = WaitViewModel;
                              WaitView.Show();
                              System.Windows.Threading.Dispatcher.Run();
                          }));
                          thread.SetApartmentState(ApartmentState.STA);
                          thread.IsBackground = true;
                          thread.Start();
  
  
  'unrelated code here
  if (dispatcher != null)
  dispatcher.Invoke(()=&gt;
  {
  WaitView.Close();
  });
  </code></pre>