During a busy Build 2018 last year, Microsoft revealed a new Windows 10 API that will give developers more freedom to create multiple windows in Universal Windows Platform (UWP) apps. Almost a year later, in a case of better late than never, Microsoft has released the class for Windows developers.
Called AppWindow, the new class allows UWP developers to run all application windows on the same UI thread. Microsoft has released AppWindow APIs with Windows 10 SDK Preview 18327.
You can learn more about AppWindow and use the APIs from the GitHub page here. While UWP developers have always been able to create multiple windows in apps, they would need to write hundreds of lines of code.
Thanks to the new class, dev's can now create these multiple windows with just a few lines of code. While the new windows would previously run on a separate thread, AppWindow places everything onto a single thread.
Working off of insider builds? We're excited to announce the new Windowing APIs for #UWP! Build better multi-tasking with the ability to create multiple windows on a single thread 👍Blog post with samples and more information here: https://t.co/oBGPNauQ0N pic.twitter.com/S5tXHdU8cA
— Windows UI (@WindowsUI) February 13, 2019
For developers who are tied down to the old method for any reason, the old multi-thread system will remain in support. Microsoft says work on AppWindow is ongoing and the current implementation is not the finished article:
“The API surface is by no means fully featured yet, we know that we still have a long way to go to get to that north-star vision of what modern windowing should be capable of in Windows.”
The company also explained why it has taken nearly a year to release the API.
“However, we also got feedback that led us to re-think some of our concepts and choices for the API surface we had presented. This led to us deciding to postpone the general release of the API by one iteration of the developer platform.”