News

Microsoft Preps WinUI 3 for Production Debut Next Month

Microsoft released a fourth and final preview of its milestone WinUI 3 offering that will debut as the native UI platform for Windows 10 next month.

WinUI uses Fluent Design to provide a native user experience (UX) framework for both Windows Desktop (Win32) and Universal Windows Platform (UWP) applications.

"It provides a way to gradually migrate existing apps written in familiar technologies like MFC, WinForms, and WPF, allowing you to move these applications forward at your own pace," the WinUI site states. "It also supports familiar languages spanning C++, C#, Visual Basic, and even Javascript via React Native for Windows."

WinUI 3 is a big milestone release because it completely revamped WinUI 2, which only supported UWP XAML, by adding those other desktop targets -- so it's now supporting every kind of Windows app -- by decoupling the whole WinUI stack from the underlying Windows OS so it can be used in older Win32 or more modern UWP apps.

WinUI 3
[Click on image for larger view.] WinUI 3 (source: Microsoft).

"WinUI also serves as the basis for cross-platform technologies that provide great native Windows experiences," Microsoft says. "React Native for Windows, Xamarin.Forms, and the Uno platform harness the power of WinUI today -- if you're currently using those platforms you're already using WinUI!"

While Microsoft just this week published preview 4 of WinUI 3 ahead of reaching supported status next month, that debut will see it repositioned as a component of the company's Project Reunion, yet another attempt to rein in all of the disparate development tooling offerings into some sort of unified package, still in the very early stages. For desktop apps alone, developers face a dizzying array of options, including WPF, WinForms, UWP, .NET MAUI, Blazor and more.

Project Reunion in Animated Action
[Click on image for larger, animated GIF view.] Project Reunion in Animated Action (source: Microsoft).

Microsoft describes Project Reunion (on GitHub here) like this:

Project Reunion 0.1 Prerelease is a preview of a new set of developer components and tools that represents the next evolution in the Windows app development platform. Project Reunion provides a unified set of APIs and tools that can be used in a consistent way by any app on a broad set of target Windows 10 OS versions. Project Reunion does not replace the existing Windows app platforms and frameworks such as UWP and native Win32, and .NET. Instead, it complements these existing platforms with a common set of APIs and tools that developers can rely on across these platforms.

Project Reunion provides a broad set of Windows APIs with implementations that are decoupled from the OS and released to developers via NuGet packages. Project Reunion is not meant to replace the Windows SDK. The Windows SDK will continue to work as is, and there are many core components of Windows that will continue to evolve via APIs that are delivered via OS and Windows SDK releases. Developers are encouraged to adopt Project Reunion at their own pace.

So, in its March 2021 debut as a production-ready concern, WinUI 3 will be part of Project Reunion 0.5, according to the project's roadmap.

WinUI 3 Roadmap (at the time Preview 3 was released)
[Click on image for larger view.] WinUI 3 Roadmap (at the time Preview 3 was released) (source: Microsoft).

In preparing for that debut, Microsoft calls Preview 4 a stability release, much like Preview 3, which nevertheless did introduce ARM64 support and hot reload functionality.

WinUI Features Map (at the time Preview 3 was released)
[Click on image for larger view.] WinUI Features Map (at the time Preview 3 was released) (source: Microsoft).

Along with fixing a bunch of bugs and other quality/stability maintenance, Preview 4 also introduced a few of its own new features, including:

  • Parity with WinUI 2.5 (includes InfoBar control, new features in ProgressRing and NavigationView, and bug fixes)
  • Custom titlebar capabilities: new Window.ExtendsContentIntoTitleBar and Window.SetTitleBar APIs that allow developers to create custom title bars in Desktop apps
  • VirtualSurfaceImageSource support

Some of the critical bugs that were fixed include:

  • WinUI 3 crash when running on Windows Insider Builds
  • WinUI 3 Desktop: Unable to Enter Text into TextBox inside ContentDialog
  • WinUI 3 Desktop: DataGrid not displaying
  • This release has taken on a new version of CS/WinRT and the Windows SDK, which fixed the following bugs:
    • Crash when binding to a URI property using {Binding}
    • C#/WinRT Marshal functions not interoperating correctly with .NET 5
  • WinUI 3 Desktop: Attempting to bring down DropDownButton or SplitButton's flyout causes app crash

Also available is a new XAML Controls Gallery for the WinUI 3 Preview 4 branch, which shows recently added samples such as WebView2 and updated samples like ComboBox, ListView and MenuBar.

WinUI 3 XAML Controls Gallery
[Click on image for larger view.] WinUI 3 XAML Controls Gallery (source: Microsoft).

Project templates available in Visual Studio 2019 v16.9 Preview (required) for building WinUI apps -- or components that can be used in WinUI-based apps -- include Blank App, Packaged (WinUI in Desktop) and Blank App (WinUI in UWP) in the former category and Class Library (WinUI in Desktop), Class Library (WinUI in UWP), Windows Runtime Component (WinUI) and Windows Runtime Component (UWP) in the latter category.

Microsoft provides guidance for using the new offering, including "Get started with WinUI 3 for desktop apps," which shows how to create a WinUI 3 desktop app for C# and .NET 5, along with sample apps on GitHub.

At this point, however, Microsoft still warns developers, "This WinUI 3 preview release is intended for early evaluation and to gather feedback from the developer community. It should NOT be used for production apps."

About the Author

David Ramel is an editor and writer at Converge 360.

comments powered by Disqus

Featured

Subscribe on YouTube