- Home /
(UWP Multi-Display) How do I fetch the Window class of the second display?
In my unity build I am successfully able to use display.Activate() to create a secondary window. I export the project instead of building it outright, so that I can do some XAML overlays on top of the project.
Using CoreApplication.Views I can see there are indeed 2 application views, and I am able to iterate them and compare them to CoreApplication.MainView so I can find the secondary view, in this case the view at index 1.
However, the following code:
await views[1].Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
{
if (Window.Current == null) Logger.Log(this, "window is null");
});
Reports that the window is null, as though RunAsync was not run on a ui thread, or a window was never created for the view.
How can I fetch the window of that secondary view, so that I can set its content, if RunAsync doesn't put me on the appropriate thread?
It may be worth noting that an exception is thrown if I try to create a new Frame() within that RunAsync call also, perhaps further suggesting it might not be a UI thread.
Your answer
Follow this Question
Related Questions
Windows Store Logo is Unity Logo 0 Answers
vuforia for windows 0 Answers
unity + vungle for windows platform ! 0 Answers
Can't run game on Windows Metro becouse of error with dll's 1 Answer