This article is more than 1 year old
Project Union: Microsoft releases Windows App SDK 1.0, developers try to puzzle it out
Multiple Windows in WinUI 3? Next version. Open source? Maybe one day
Microsoft released the Windows App SDK 1.0 earlier this month, the first full release of "Project Reunion", but there is some confusion about what it is and whether developers need it.
The release of the Windows App SDK was associated with the arrival of .NET 6.0, a long-term release of Microsoft's application platform, but it is not exclusively a .NET API. What is it then?
Unfortunately the answer is complex which is why Microsoft has struggled to articulate it. The best effort is this GitHub post which describes it as a combination of new APIs with converged APIs that can wrap both Win32 and WinRT – where Win32 is the original and low-level Windows API, and WinRT the modern binary interface introduced for Windows 8.
At one time WinRT and then UWP (Universal Windows Platform) was meant to be the future of Windows development, but this has not worked out, leaving Microsoft with the task of reuniting what it forced apart, hence "Project reunion."
WinUI 3, the latest GUI framework from Microsoft, is a component of the Windows App SDK, but it is not essential to use it.
One way to think of it is that WinUI 3 is the UWP user interface detached from the UWP application model, the twist being that UWP cannot use WinUI 3 so will gradually fall behind. WinUI 3 does require a recent version of Windows, specifically Windows 10 version 1809 (October 2018) or later.
To nobody's surprise, the first WinUI 3 is not complete. One notable omission is multiple window support, leading to issues like this one: "When I try to create a new window other than the MainWindow, it throws an Exception from KernelBase." The answer: "Unfortunately the support for multiple Windows was not finished in time to be included in 1.0."
Other features on the way in the second quarter of 2022 are elevation support (run as local administrator) and toast notifications.
Microsoft explains that developers can migrate to the Windows App SDK gradually. "You'll start using these APIs by adding a reference to the Windows App SDK NuGet package and then adding uses of the APIs in your app code. Use as much or as little of Windows App SDK as helps your application," said the team.
It is also not necessary to use the Windows Store or MSIX packaging. The App SDK works with both packaged and non-packaged applications.
Some developers have struggled with all these distinctions. "I see I can create a new 'WinUI 3 in Desktop' app. If I do that, the resulting file has got some XAML in with a project structure that looks a bit like UWP or WPF XAML. Is this a WinUI 3 app or a Windows App SDK app?" said one developer, admitting to being "right royally confused."
Ben Kuhn, software engineering lead at Microsoft, responded that such an app would be both, though an app could also use the App SDK without WinUI 3.
An "Ask me anything" session with the App SDK team on Reddit proved illuminating. Why is a UWP-style UI slow? "Performance will be an area of focus for us in 2022" said the team, though "most of the UI elements render pretty quickly already."
It was noted, though, by another developer that "UWP XAML is actually really quick, but it seems that performance was completely thrown out the windows with WinUI 3 when was ripped out of the OS compositor" – referencing the way WinUI 3 was decoupled from the operating system.
Where are XAML islands, the ability to use WinUI 3 within an app built with another GUI framework? "It's probably an overall 2 year+ journey" confessed the team, saying that work to implement this will "continue thru (sic) 2022, and into 2023."
Why is WinUI 3 not open source as originally promised? "A very fair question," said Microsoft program manager Ryan Demopoulos. "Retroactively open sourcing a codebase of over 3 million lines, which includes fixing thousands of private API calls, was harder than we thought it would be."
It is still planned, he implied, but at the stage of setting up "conversations with our team about what to do about open source." That does not sound like soon.
- Oh dear, Universal Windows Platform: Microsoft says 'no plans to release WinUI 3 for UWP in a stable way'
- .NET 6 LTS and VS 2022: Major releases spoilt by continuing concern about Microsoft's commitment to open source
- Microsoft's UWP = Unwanted Windows Platform?
- Developing for Windows 11: Like developing for Windows 10, but with rounded corners?
It does seem that WinUI 3 is not altogether ready yet, despite its 1.0 designation. "WinUI 3.0 is basically a reboot back to Windows 8 capabilities, with lots of features not available… having been burned with so many rewrites since Windows 8, I would not consider WinUI until they actually ship any major Microsoft application on it, like Office," said a developer.
Example applications are few though the team said "we're working with a lot of internal Microsoft apps and Windows Components on shipping with WinAppSDK. We'll talk more about these as they get closer to release."
Why bother? The team referenced this article on how to write an application that fits perfectly on Windows 11. This includes using the latest common controls (things like checkboxes, sliders and lists), using the Acrylic and Mica design textures, supporting rounded window corners and Windows 11 snap layouts, supporting a dark theme as well as light, and using the new Segoe UI font and Windows 11 icons.
"We recommend all apps switch to using these new icons and font to be coherent on Windows 11," the docs say.
Developers will be sceptical though. Users are only just getting started with Windows 11. The new SDK is not mature.
An application that looks right on Windows 11 may look dated on Windows 12, whenever it comes, and cross-platform is a necessity for many types of application, pushing developers towards web technology that looks more future-proof.®