feature: help with winui 3 support
Gitii opened this issue · comments
Is your feature request related to a problem? Please describe.
Currently there is no support for winui 3.
Describe the solution you'd like
I have ported the existing UWP-integration to winui (or to be more precise: to Microsoft.WindowsAppSDK
).
Mainly I had to change the imports.
I could create a PR that integrates it directly
OR publish it as a standalone package.
OR use some conditional compilation magic and reuse 99% of the existing code.
I happy to do necessary changes (PR) for either solution :)
Regardless of the outcome, I also stumbled across a few design choices (in the original UWP code) which I do not understand.
Could someone of the maintainers answer them please? I am curious :)
DependencyResolverMixins.cs
:RegisterNavigationView(..., Func<TView> navigationViewFactory)
accepts a factory method which is called inside the method.
That's effectively the same as passing in the final value. I used anLazy<(TView, ViewStackService)>
instead. Worked flawlessly, but I do not understand why it's designed to work this way?- Sextant's
NavigationView
is barebone navigation component and works well. But there's also the nativeNavigationView
which could have been extended instead. It's always possible to use a custom navigation component but this is not clearly documented either.
Thank you for this amazing package and best regards,
Gitii
@Gitii We would gladly work with you to get what you have integrated into this package. Should be just a PR probably with a WinUI3
platform, or a separate Sextant.WinUI project. If we need to do more or something different to support it easier, we'll assess after we get your PR in.
- It was designed that way because of simplicity and a lot of the legacy Splat container registrations use a
Func
implementation when you have to construct your ViewModel. I think a Lazy implementation either alongside or replacing it should be just fine. Splat doesn't have a very goodLazy
story, so it was probably just to keep things simple. - This question is a bit more in-depth. This is really a platform-specific thing. The Xamarin Forms implementation does extend the Xamarin.Forms
NavigationPage
, so I think doing that for WinUI is fine.
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.