reactiveui/Sextant

feature: help with winui 3 support

Gitii opened this issue · 3 comments

Gitii commented

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 :)

  1. 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 an Lazy<(TView, ViewStackService)> instead. Worked flawlessly, but I do not understand why it's designed to work this way?
  2. Sextant's NavigationView is barebone navigation component and works well. But there's also the native NavigationView 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.

  1. 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 good Lazy story, so it was probably just to keep things simple.
  2. 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.
Gitii commented

I have created the PR: #561

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.