Skiasharp: [FEATURE] WinUI 3 support

Created on 17 May 2020  ·  12Comments  ·  Source: mono/SkiaSharp

Is your feature request related to a problem? Please describe.
Currently SkiaSharp Views for UWP are based on the Windows.UI.Xaml.* namespaces.

In the future, WinUI will become the recommended UI base library for new .net applications (both for Win32 apps and UWP apps). This library makes use of the Microsoft.UI.Xaml.* namespaces.

Mixing the Windows-bound namespaces with the decoupled namespaces is likely impossible.

Describe the solution you'd like
A version of SkiaSharp that is able to be used in WinUI apps.

Additional context
https://microsoft.github.io/microsoft-ui-xaml/
https://github.com/microsoft/microsoft-ui-xaml

Most helpful comment

After some more research, it looks that WinUI 2 is not really going to change anything for UWP today. However, WinUI 3 is basically UWP 2.0 and will require new views.

So far in my PR, I have "copied" the UWP views, but changed the namespaces.

All 12 comments

lol, bringing in my tweets to get me to work 😄

OK, let me have a look 😆

😅

I'm just super excited that you're looking at it!

What should the namespace be?

SkiaSharp.Views.WinUI ?

I don't think WinUI does anything... I derive from Canvas and SwapChainPanel, neither of which are actually in WinUI...

I am really using the base types in SkiaSharp.Views.UWP.

After some more research, it looks that WinUI 2 is not really going to change anything for UWP today. However, WinUI 3 is basically UWP 2.0 and will require new views.

So far in my PR, I have "copied" the UWP views, but changed the namespaces.

Yup @mattleibow you're right, WinUI 2.x is just a library for the existing UWP platform. WinUI 3 is lifting everything to be independent of the OS to run on its own, so all the namespaces are changing (thus the need for a new view).

Most folks are using .WinUI vs. '.UWP` for packages with this transition. Thanks for putting this together! 🦙❤

So far in my PR, I have "copied" the UWP views, but changed the namespaces.

Yes that was my point :) a class inheriting from a class that sits in the current UWP namespaces (Canvas) cannot be used in projects based on WinUI 3.

Great that you're starting this!

Soon .NET 5 and WinUI 3 preview 3 will be out, and we are considering switching from UWP to WinUI at that point. Could you update me on the current state of WinUI 3 support in SkiaSharp?

@rick-palmsens WinUI 3 is still in development, so this feature is about adding parallel support for WinUI 3 alongside the current UWP infrastructure. I don't think the Skia team has made any decisions yet on future plans to completely move to just WinUI 3 and not support UWP at this time.

For instance for the Windows Community Toolkit our main code is still based on UWP. We ship previews alongside the WinUI 3 previews for folks to try out ahead of time, which is what this issue is alluding to. For our previews, we currently only support Win32 Desktop WinUI 3 previews (as WinUI 3 UWP doesn't support .NET 5 yet officially). Once WinUI 3 ships and supports both Desktop and UWP environments on the latest .NET, then we'll move our Toolkit development over to the new base.

@michael-hawker We intent to drop UWP and go for Win32 instead because of the lack of support for UWP from every part of the .NET ecosystem, so I am mainly interested in WinUI 3 support for Win32.

Was this page helpful?
0 / 5 - 0 ratings