PageResolver #415
Closed
matt-goldman
started this conversation in
New Feature Discussions
Replies: 2 comments
-
I really like having the ability to resolve a view and it's dependency tree if not using |
Beta Was this translation helpful? Give feedback.
0 replies
-
Closed as answered |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Last year I released a NuGet package with some extension methods for
INavigation
that use the built in ServiceProvider to resolve dependencies for pages and push them onto the navigation stack. The wiki has detailed instructions on how to use it and there's a video on YouTube breaking it down too.Recently James Montemagno suggested on Twitter that this package might be a good fit for the Community Toolkit. There's also a discussion on the .NET MAUI repo suggesting that this approach might be a good fit for .NET MAUI itself.
I feel this approach complements Shell by offering the same automatic resolution of dependencies but using INavigation. It's also useful even with Shell for pushing modal pages.
Keen to hear other people's thoughts on this. Do you think this would be a good fit for the Community Toolkit? I would be happy to port it in if people do.
There's also an add-on package called AutoReg with a source generator to automatically register Pages, ViewModels and Services with the ServiceProvider based on a naming convention. My gut feeling is that this isn't as good a fit for the Community Toolkit, but again if people feel like it is I would be happy to port it in (it's kind of experimental and a PoC at the moment so would need some work).
PS thanks to @bijington for talking me through this process.
Beta Was this translation helpful? Give feedback.
All reactions