Xamarin.Forms: ShellContent Navigation

Intro

I came across a scenario in which my app exposed multiple methods for navigating to a particular page.

Method 1: XAML

One exposed method was from the app menu in which the navigation was implemented in XAML:

XAML

Method 2: Code-behind of  Initial page

Another exposed method was to perform navigation from another page’s code-behind:

Programmatic_shell_navigation

Method 3: Code-behind of Target page

Unfortunately, there was no current way to specify navigation arguments in XAML even though the navigation mapping was defined in XAML.

Thus, I had to override the target page’s OnAppearing method to handle post-navigation details (i.e. arguments):

Codebehind

One Reply to “Xamarin.Forms: ShellContent Navigation”

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: