Xamarin.Forms Shell Quick Tip - Modal Navigation

Xamarin.Forms Shell Quick Tip - Modal Navigation

Control exactly how your pages are displayed when navigating leveraging the PresentationMode built into Xamarin Today, I want to talk about a common feature of navigation where a new page pops up over the current page.

In the Shell quick tip series we explored navigation features of Shell including passing data and going back easily. Today, I want to talk about a common feature of navigation where a new page pops up over the current page. This is different than traditional navigation where a page is pushed onto the stack. A modal page requires the user to perform an action to close the page such as tapping a close button or completing registration. With Xamarin.Forms Shell we can easily navigate using modal pages with a specific property

Presentation mode

Xamarin.Forms Shell handles all navigation styles through a property called PresentationMode. You can use it to perform modal navigation with or without animations. Additionally, you can use it with non-modal navigation to control how pages are pushed onto the stack. The mode I prefer to use is ModalAnimated to get that nice slide up from the bottom effect.

Shell.PresentationMode="ModalAnimated"

This property goes directly into the Content page top element of your page:

<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
             xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
             x:Class="App11.Views.ModalPage"
             Shell.PresentationMode="ModalAnimated">

You are also able to set it directly in the code behind if you are using C## markup for your user interface.

Shell.SetPresentationMode(this, PresentationMode.ModalAnimated);

developers xamarin.forms navigation shell xamarin.forms shell xamarin

Bootstrap 5 Complete Course with Examples

Bootstrap 5 Tutorial - Bootstrap 5 Crash Course for Beginners

Nest.JS Tutorial for Beginners

Hello Vue 3: A First Look at Vue 3 and the Composition API

Building a simple Applications with Vue 3

Deno Crash Course: Explore Deno and Create a full REST API with Deno

How to Build a Real-time Chat App with Deno and WebSockets

Convert HTML to Markdown Online

HTML entity encoder decoder Online

Xamarin Forms Training Institute | Xamarin Forms Development Classes | Xamarin Training

Xamarin Training course is primarily designed for Beginner(s)/Professional(s) who want to learn how to develop native cross-platform apps with C# that run-on Android, iOS and Windows.

Top Xamarin App Development Company in USA

AppClues Infotech is a top Mobile App Development Company in USA building high-quality Android, iOS, and Native apps for Startups, SMBs, & Enterprises. Contact us now!

Cut Down Your App Development Cost with Xamarin

We are a renowned Xamarin app development company that offers premium Xamarin mobile application development services. Hire our seasoned Xamarin developers!

How long does it take to develop/build an app?

This article covers A-Z about the mobile and web app development process and answers your question on how long does it take to develop/build an app.

Developer Career Path: To Become a Team Lead or Stay a Developer?

For a developer, becoming a team leader can be a trap or open up opportunities for creating software. Two years ago, when I was a developer, ... by Oleg Sklyarov, Fullstack Developer at Skyeng company