{"id":9418,"date":"2022-08-13T13:54:13","date_gmt":"2022-08-13T13:54:13","guid":{"rendered":"http:\/\/putridparrot.com\/blog\/?p=9418"},"modified":"2022-08-13T13:54:13","modified_gmt":"2022-08-13T13:54:13","slug":"navigating-to-different-pages-using-maui-and-shell","status":"publish","type":"post","link":"https:\/\/putridparrot.com\/blog\/navigating-to-different-pages-using-maui-and-shell\/","title":{"rendered":"Navigating to different pages using MAUI and Shell"},"content":{"rendered":"<p>By default MAUI includes the Shell (see AppShell.xaml\/AppShell.xaml.cs). We can use method on this object to navigate to pages in MAUI, for example if we add a simple AboutPage and want to navigate to it from a our view model we can write something like this<\/p>\n<pre class=\"brush: csharp; title: ; notranslate\" title=\"\">\r\n&#x5B;RelayCommand]\r\nprivate async Task About() =&gt; await AppShell.Current.GoToAsync(nameof(AboutPage));\r\n<\/pre>\n<p><em>Obviously the nameof(AboutPage) maps the the name we&#8217;ll be registering for the AboutPage.<\/em><\/p>\n<p>Now we need to register the page within the shell, so go to AppShell.xaml.cs and add the following<\/p>\n<pre class=\"brush: csharp; title: ; notranslate\" title=\"\">\r\nRouting.RegisterRoute(nameof(AboutPage), typeof(AboutPage));\r\n<\/pre>\n<p>That&#8217;s all we need to do.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>By default MAUI includes the Shell (see AppShell.xaml\/AppShell.xaml.cs). We can use method on this object to navigate to pages in MAUI, for example if we add a simple AboutPage and want to navigate to it from a our view model we can write something like this &#x5B;RelayCommand] private async Task About() =&gt; await AppShell.Current.GoToAsync(nameof(AboutPage)); Obviously [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[330],"tags":[],"class_list":["post-9418","post","type-post","status-publish","format-standard","hentry","category-maui"],"jetpack_sharing_enabled":true,"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/putridparrot.com\/blog\/wp-json\/wp\/v2\/posts\/9418","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/putridparrot.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/putridparrot.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/putridparrot.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/putridparrot.com\/blog\/wp-json\/wp\/v2\/comments?post=9418"}],"version-history":[{"count":2,"href":"https:\/\/putridparrot.com\/blog\/wp-json\/wp\/v2\/posts\/9418\/revisions"}],"predecessor-version":[{"id":9420,"href":"https:\/\/putridparrot.com\/blog\/wp-json\/wp\/v2\/posts\/9418\/revisions\/9420"}],"wp:attachment":[{"href":"https:\/\/putridparrot.com\/blog\/wp-json\/wp\/v2\/media?parent=9418"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/putridparrot.com\/blog\/wp-json\/wp\/v2\/categories?post=9418"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/putridparrot.com\/blog\/wp-json\/wp\/v2\/tags?post=9418"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}