microsoft / WindowsAppSDK

The Windows App SDK empowers all Windows desktop apps with modern Windows UI, APIs, and platform features, including back-compat support, shipped via NuGet.
https://docs.microsoft.com/windows/apps/windows-app-sdk/
MIT License
3.86k stars 328 forks source link

Support installing Reunion without referencing WinUI 3 #1124

Open JaiganeshKumaran opened 3 years ago

JaiganeshKumaran commented 3 years ago

Today if you install Reunion, it will reference WinUI 3. This means you can't use it alongside Platform XAML with WinUI 2.x as WinUI 2.x has the types with the same name in the same namespaces.

riverar commented 3 years ago

@dotmorten Did you previously write something up along these lines? Can't find it if so.

asklar commented 3 years ago

note that cswinrt would still be coupled to winui3 until microsoft/CsWinRT#723 is addressed

BreeceW commented 2 years ago

I was trying to add the new AppWindow to an application using XAML Islands and WinUI 2.7 to get a nicer title bar. The problem is that once I added the Microsoft.WindowsAppSDK 1.0.0 package to the project (.wapproj file), it would crash on trying to create the muxc:XamlControlsResources (WinUI 2.7). I assume this problem comes from Windows App SDK bringing in its own WinUI 3 XamlControlsResources instead, which is of course incompatible. I would like to be able to use AppWindow without bringing WinUI 3 into the application, which apparently prevents me from using WinUI 2.7 (without XamlControlsResources in App.xaml, the app works fine—just with the outdated styles, and I assume that WinUI 2.x controls wouldn’t work).

So as far as I can tell, it’s effectively impossible to use Windows App SDK if you’re an app like Windows Terminal (XAML Islands + WinUI 2.x). Based on discussion in https://github.com/microsoft/WindowsAppSDK/issues/593, which I believe @riverar might have been referring to, it seems like this is intentional, but it completely blocks this scenario, unless I’m missing something.

ghost commented 2 years ago

Windows App SDK includes WinUI 3.x+ and WinUI 3.x+ Islands, not WinUI 2.x. So By definition, Windows App SDK (that includes AppWindow) can only work with WinUI 3.x+ and WinUI 3.x+ Islands, not WinUI 2.x.

All WinUI 2.x apps will have to be upgraded to WinUI 3.x+ or WinUI 3.x+ Islands when it is available.

JaiganeshKumaran commented 2 years ago

Please make this quick. As currently advertised, WindowsAppSDK is supposed to be usable from any app that uses any framework, including UWP apps. Don't require UWP apps to migrate to WinUI 3 just to use WindowsAppSDK, while still letting other frameworks (eg: WPF/WinForms on .NET Core) use it directly without necessarily migrating to WinUI 3. It feels like UWP isn't treated equally along with other legacy technologies and is seen as an exception.