How to pass query parameters for QueryProperty in shell. #14
-
Hi, I am using shell currently in my app. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
You can't pass query parameters as the constructor, but the same way you map them in your ViewModel (using an attribute) should work. But if you're using Shell for navigation, you don't need PageResolver; Shell does dependency resolution for you. Does this answer your question? If not, can you give a little more information about your use case? A small code sample or repo would help. |
Beta Was this translation helpful? Give feedback.
-
Hi @Awesomer9561, just thought I'd revisit this discussion. If you're using Shell, you can pass parameters as navigation properties. These can be picked up either by the page you are navigating to, or the page's binding context. You can see more in this doc: https://learn.microsoft.com/dotnet/maui/fundamentals/shell/navigation?view=net-maui-7.0#pass-data Since writing my previous answer, passing parameters via the constructor is now possible with PageResolver. You can see more about this approach in the wiki: https://github.com/matt-goldman/Maui.Plugins.PageResolver/wiki/1-Using-the-PageResolver#15-use-parameters |
Beta Was this translation helpful? Give feedback.
Hi @Awesomer9561, just thought I'd revisit this discussion.
If you're using Shell, you can pass parameters as navigation properties. These can be picked up either by the page you are navigating to, or the page's binding context. You can see more in this doc: https://learn.microsoft.com/dotnet/maui/fundamentals/shell/navigation?view=net-maui-7.0#pass-data
Since writing my previous answer, passing parameters via the constructor is now possible with PageResolver. You can see more about this approach in the wiki: https://github.com/matt-goldman/Maui.Plugins.PageResolver/wiki/1-Using-the-PageResolver#15-use-parameters