I do know how to open additional windows using TryShowAsStandaloneAsync
. However, if the original window is closed - TryShowAsStandaloneAsync
fails (Wh
Have a look at the MultipleViews sample app. This app does have the problem you're describing.
Each view that you create will have their own UI Thread, and therefore dispatcher.
The key to this app is that TryShowAsStandaloneAsync
is called from the dispatcher of the currently active window.
In the sample's OnLaunched
event, the code looks for a reference to the currently open view, using the view id from the launch arguments. It then uses the dispatcher associated with that view to call UI code, using Dispatcher.RunAsync
, on that view's UI thread. You should use that thread of the open window to call TryShowAsStandaloneAsync
to launch your new main view. You can then call Window.Activate
using the new main view's dispatcher.