r/Windows10 • • Sep 03 '19

Official The Windows XAML Platform program manager at Microsoft, confirms that Win32 won't get true first-class WinUI status, and that UWP is still the main platform going forward

https://twitter.com/marbtweeting/status/1168744160142061568
38 Upvotes

30 comments sorted by

View all comments

24

u/groundpeak Sep 03 '19

I don't think this title is accurate. The tweet simply states that XAML Islands will still be used in situations where you need to mix Win32/WinForms/WPF controls with WinUI controls within a single Window.

I need to do some more reading about WinUI 3.

7

u/NiveaGeForce Sep 03 '19 edited Sep 03 '19

You might be right, but here they say

https://github.com/microsoft/microsoft-ui-xaml/issues/717

Adding WinUI 3.0 to existing Win32 apps

WinUI 3.0 will include Xaml Islands, which let you use WinUI Xaml in your existing WPF, Windows Forms, and C++ Win32 applications.

And here they say

https://github.com/microsoft/microsoft-ui-xaml/blob/master/docs/roadmap.md

Native development support

WinUI can be used with .NET, but doesn't depend on .NET: WinUI is 100% C++ and can be used in unmanaged Windows apps, for example using standard C++17 via C++/WinRT.

Anything WinRT doesn't sound like true first-class to Win32 to me.

See also

1

u/xeveri Sep 03 '19

Isn’t winRT just a wrapper around win32?

1

u/xezrunner Sep 03 '19

Isn’t winRT just a wrapper around win32?

The Start screen, charms bar, search panel, OOBE and logon UI in Windows 8 & 8.1 were all WinRT, C++ code, and aside from the last two, they all depended on explorer.exe

It felt more robust than what XAML was capable of.

-1

u/NiveaGeForce Sep 03 '19 edited Sep 03 '19

On Windows 10, not exactly

https://stackoverflow.com/questions/8254988/does-winrt-access-the-nt-kernel-directly-when-it-needs-os-support-or-does-it-g

Both - some parts of the Windows runtime are new top-to-bottom (and thus interact directly with kernel services), other parts of the Windows runtime (WinRT) use existing services in Windows.

On the upcoming Windows Core OS, the situation seems somewhat different.

https://www.windowscentral.com/windows-core-os

7

u/DHowett Sep 03 '19 edited Sep 03 '19

Speaking as somebody who's had to implement "WinRT" APIs first hand: it's not a new subsystem, and it's almost entirely built on top of Win32. WinRT is really just an extension of COM with some niceties around runtime class interrogation, "brokered" hosting and class naming (so you can deal with class names instead of CLSIDs). On top of that is a new set of APIs, but it's all just Win32 and COM under the hood.

There was a good amount of backlash when the Win32 APIs were deemed "legacy", so since Windows 8 they've been incrementally undeprecated and "allowed" to coexist.

As for XAML islands: XAML is itself a technology built with these "runtime classes", and you need to be able to interact with them somehow. That doesn't mean that you need to be a UWP, or that UWP is the only path forward.

EDIT: parent comment seems to have been edited to remove the assertion that WinRT was a new API surface on top of the NT kernel. This makes my comment make slightly less sense.

2

u/NiveaGeForce Sep 03 '19

The Windows XAML Platform program manager corrected me, and posted some clarifications.

https://www.reddit.com/r/Windows10/comments/cz1edg/the_windows_xaml_platform_program_manager_at/eywt7aa/

I'm sorry if I wasn't clear in my post and caused misunderstandings. As we already have made public, WinUI 3 will work inside of a UWP app model (UWP) and Win32 app model (Desktop). Using your own words; we consider both platforms as first-class, and WinUI 3 will support them. WinUI 3 will adapt to the execution environment, for instance, WinUI 3 in UWP apps is using CoreWindow, and WinUI 3 in Desktop is using HWnd (and several more differences).

Besides WinUI 3 in UWP and Desktop, XAML Islands is part of the WinUI 3, as I made public too. The low-level hosting APIs (e.g., DesktopWindowXamlSource) will be lifted from the OS and include on WinUI 3. This will allow using the WinUI 3 controls in WPF, WinForms, or even MFC apps down to Win10 1703, RS2 (Although RS2 is not 100% sure yet)

We will try to add more clarity in the following weeks in the WinUI GitHub site. There are more details that we can't share yet (to avoid these misunderstandings, sorry again), and we are planning to make it public at Ignite in Nov.

WinUI 3 in desktop apps will use some low-level APIs (that rule XAML Islands today) internally and new pieces that we are creating to have a first class class experience. So, these developers, who start a new WinUI 3 project in Win32 app model, will see nothing about XAML Islands. There is no point for that, right?

Those apps that requires to mix WPF/WinForms/MFC/etc and WinUI in the same UI will need to use the WinUI XAML Islands. For instance, a version of the .NET wrapper controls like WindowsXamlHost.

2

u/groundpeak Sep 03 '19

Given that there's already a significant overlap between 'UWP' and .NET Standard (which is also the basis for. NET 5 going forward), I'd be interested in what the differences between a WinUI-based .NET 5 application and a UWP application actually are - particularly if we assume the .NET app is delivered via MSIX/the Store.

On a cosmetic level, they would be identical. I guess the UWP app would run in an AppContainer by default and the .NET app would not?