WinUI Community Call - June 2024

WinUI Community Call - June 2024

What is WinUI?

WinUI is the native UI platform for Windows 10 and Windows 11 and is built for modern hardware and devices offering the latest Fluent styling allowing developers to build rich .NET and C++ applications. WinUI powers the Windows shell, many applications such as Dev Home, Apple TV and File Explorer along with platforms such as .NET MAUI and React Native for Windows.

WinUI 3 is the latest third-generation of the native user experience stack in Windows and consolidates the technologies previously built into Windows into a single decoupled framework that ships as part of the Windows App SDK. Windows App SDK provides a unified set of APIs and tools to develop rich and engaging Windows desktop applications. WinUI 3 ensures your application runs exactly the same on different version of Windows 10 and 11 from Windows 10 RS5 and up. Microsoft Photos was migrated from Universal Windows Platform to the Windows App SDK which included benefits in performance after the change and you can read more about this at Microsoft Photos: Migrating from UWP to Windows App SDK

Microsoft Build 2024 Recap

Microsoft is investing in client development including Windows Native. WInUI, WPF and Windows App SDK where WinUI powers key experiences on Windows and is optimised for modern experiences and is a great choice for new apps or if don't know where to start and has modern UI with usability built in. WPF has a very rich ecosystem and is very stable with lots of documentation and tutorials and supports C# very deeply and has introduced modernisation through theming. Windows App SDK is something you can use throughout WinUI and WPF and enables incremental adoption, predictable consistency and supports controlled updates.

Microsoft has gallery apps for WinUI and WPF and the WPF Gallery looks like the WinUI one and looks very modern, and documentation has been updated for WinUI and WPF as a one-stop-shop for information you need on those platforms. Windows 11 theming has been introduced in WPF which has been an investment to make it look more Fluent and look more modern along with the WPF Gallery will show how controls will look and behave with the new theming. With .NET 9 font ligature support will be improved in WPF along with additional hardware acceleration and more exciting things are happening in WPF and Microsoft are committed to serving the community better and there is more parity across WPF and WinUI.

There is now an improved workflow selection in Visual Studio to know that WinUI should be the framework you are using so people who are new to Windows development they know what framework to use with the Windows application development workflow and now WinUI is the default for creating native Windows apps. Microsoft have also worked to make WinUI templates to have a higher priority. Also in future when do File, New Project will create a great default application including the TitleBar with snap support which will be available in Windows App SDK 1.6.

Windows App SDK 1.6 Experimental Features

C# native Ahead of Time compilation support is there but there will be additional work to make it easier to use and add warnings for potential edge cases. There is also a new TitleBar control, there are multoiple aspects which include having more advanced things such as textboxes along with having light and dark theme working and there will be improved tabview tab tear-out which provides a more browser like experience like you would see in Edge or Chrome but one of the bonuses is it doesn't use drag-and-drop functionality.

There is also now an unsealed ItemsWrapGrid control and have ensured this is not a breaking change but there is still a lot of testing and feedback needed to ensure it works but is first step to unsealing everything to allow developers to subclass any control they want. There is also a new wrap mode for Pips pager when going from first to last page and a new more customisation rating control including resizing the stars and making the spacing larger to get the experience you want.

With Ahead of Time or AoT compilation with an example application has seen a 50% reduction in start time, 8X reduction in package size for framework package and 2X reduction in package size if self-contained.


Windows App SDK 1.6 will include changes to the default system title bar experience as before you would see a Win32 title bar which would not adapt to themes but you will now see this change between light theme and dark themes, but you can enable or disable with the DefaultTitleBarShouldMatchAppModeTheme property which should be enabled by default in Windows App SDK 1.6. There are APIs on the AppWindow titlebar where you can change the theming to match your application. If you want to extend the client area into the Titlebar to include more options you can use the Titlebar, before if you wanted to customise the Titlebar you would have to implement drag regions along with ensuring you can still click elements, and this was too complicated and introduced too many issues.

There is now TitleBar XAML control which allows for more customisation options and elements you may want to control are now properties, you can set the title or can add a subtitle for your application being in a certain state but also have buttons that are usually in the same spot such as a back button and pane toggle button which can be toggled on or off as needed, you can also set things like the source for the icon for in the TitleBar. You can also do more things with the TitleBar control such as areas of the title bar where you can add XAML elements for a content area such as an AutoSuggestBox in the centre of the TitleBar or can add a Footer area for the right side of the title bar where you could specify a PersonPicture control. All of the elements will adapt to system theming and contains most standard reasons for customising the title bar as needed by developers.

TitleBar will be coming in Windows App SDK 1.6 experimental, and the header contains a back button, pane toggle button, icon, title, subtitle, content, footer and caption buttons which are still controlled by the system with everything in the content and footer area can be added as any XAML control. There are also drag regions and interactive regions which are defined for you so you can drag an application normally. You could have a simple TitleBar then could add content to search or more buttons along with having a default or tall height title bar for more space.

Tab Tearing

Windows App SDK 1.6 will support improved tab tear out. File Explorer uses Tab tear out at the moment only shows the tab and the drag and drop experience isn't as good as it is in Microsoft Edge but now there is a move size loop and if drag a tab it immediately becomes a new Window and if moved back it rejoins the rest of the tabs and also due to using the move size loop it will be able to be immediately maximised by dragging the top of the tab window to the top or snapped as a Windows as needed and allows for a more fluid experience.