Hello!
As I remember WPF Dispatcher thread is main thread, whose handling all UI control. So if you are going to render or control any UI component; you have to use Dispatcher thread.
Now came back to your question. As I understand, you have 2 windows, and you want to hide the main window with another one. In other words, you are actually changing main window.
This can be achieved by getting Current App dispatcher thread, and set current window.
e.g.
Application.Current.Dispatcher.Invoke((Action)delegate
{
SecondWindow window = new SecondWindow ();
App.Current.MainWindow.Close();
App.Current.MainWindow = window;
App.Current.MainWindow.Show();
});
Note that I am Using
Application.Current.Dispatcher.Invoke
because I am invoking from secondary thread (using Task). Otherwise you are not allowed to play with UI controls from secondary thread