I created new Window on a different thread because it has heavy UI operations, that was done to keep my main window run smoothly. Everything works perfectly.
But here is the question:
How I can access newly created window?
After calling Dispatcher.Run() I can not manipulate visualisationWindow anymore. I want to keep access to that newly created window object.
Here is how my window created:
private void CreateVisualisationWindow() { Thread VisualisationWIndowThread = new Thread(new ThreadStart(ThreadStartingPoint)); VisualisationWIndowThread.SetApartmentState(ApartmentState.STA); VisualisationWIndowThread.IsBackground = true; VisualisationWIndowThread.Start(); } private void ThreadStartingPoint() { Visualisation visualisationWindow = new Visualisation(); visualisationWindow.Show(); System.Windows.Threading.Dispatcher.Run(); } Also I tried accessing it through System.Windows.Threading.Dispatcher.FromThread(VisualisationWIndowThread) but seems I misunderstand some core things.