Replies: 1 comment 5 replies
-
I believe the difference is in using or not using "shell". |
Beta Was this translation helpful? Give feedback.
5 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.
-
Hi. I've started watching some beginner tutorial videos on Maui and I must say some simple tasks already got me a bit confused, because I see different ways to do them in different videos.
For example navigation between pages. The very first video I saw used routing. You define a Route string inside the ShellContent tag in the AppShell.xaml and then i the code-behind you register it with:
Routing.RegisterRoute("NewPage", typeOf('PageName')).
So then, when I need to navigate to that page I can simply use:
await Shell.Current.GoToAsync("NewPage");
Seemed simple enough, didn't pass any arguments though (I don't know if that would be possible with this method).
I'm watching a different video now and he's using a different approach. We create a different ContentPage, let's say "NewPage" and then we can navigate to that page from another page simply by using:
Navigation.PushAsync(new NewPage());
In fact, we could pass some arguments this way by changing the constructor of the NewPage and passing the appropriate argument inside the PushAsync method.
What's the deal here? Are there 2 different ways to do the same thing? Are there any other differences or cases I would prefer one over the other? Or am I that confused that they are used in different cases?
Beta Was this translation helpful? Give feedback.
All reactions