SlideShare a Scribd company logo
Xamarin Navigation Patterns
Dan Hermes
developer, author, consultant,
founder of Lexicon Systems
dan@lexiconsystemsinc.com
www.mobilecsharpcafe.com
@danhermes
About me
• Software consultant since 1999
• Code, write, and lead teams
• Minecraft, tiki cocktails, my parrot, and digital art
• I love Xamarin
Xamarin Book
Now Available on Amazon
“This weighty book gives clear guidance that will help you
build quality apps, starting with architectural considerations,
and then jumping into practical code strategies.”
- Bryan Costanich, Vice President, Xamarin
“Dan Hermes’ extraordinary book is the most intelligent work
on cross-platform mobile development I’ve seen.”
– Jesse Liberty, Director of New Technology Development, Falafel Software,
Xamarin Certified Developer / Xamarin MVP
• Founded in 1999
• Develop web and mobile
apps
• Microsoft technology stack
We build apps for business
Our Clients Include
What is Navigation?
What is Navigation?
Gets our user from place to place
What is Navigation?
Provides the UI skeleton of our entire app
What is Navigation?
Gives users what they need to get around
an app quickly, moving from screen to
screen with confidence and ease
Navigation Patterns
•Hierarchical
•Modal
•Drill-down list
•Navigation drawer
•Tabs
•Springboard
•Carousel
Hierarchical
Modal
Drill-down List
Navigation Drawer
Tabs
Springboard
Carousel
Xamarin.Forms Navigation
Navigation Pattern Xamarin.Forms Class
Hierarchical NavigationPage
Modal NavigationPage, alerts, and ActionSheets
Drill-down lists NavigationPage, ListView, and TableView
Navigation drawer MasterDetailPage
Tabs TabbedPage
Springboard images with gesture recognizers
Carousel CarouselPage
Most Common
Navigation Patterns
• Hierarchical
• Modal
Hierarchical
• stack-based pattern
• allows users to move down into a stack of screens
• pop back out again, one screen at a time
• drill-down or breadcrumb
Hierarchical:
Up and Back Buttons
Up
Back
Up
Hierarchical Navigation
using NavigationPage
• Instantiate a NavigationPage and pass in a ContentPage
• In the child page:
• Set Title and Icon Properties
• Navigation.PushAsync (new MyPage)
• Navigation.PopAsync();
NavigationPage
public class App : Application {
{
public App()
{
MainPage = new NavigationPage(new HomePage());
}
}
NavigationPage
• Demo: HomePage
NavigationPage:
Remove and Insert
• Navigation.RemovePage(page);
• Navigation.InsertPageBefore(insertPage, beforePage);
Back Button
public override void OnBackButtonPressed()
{
// your code here
base.OnBackButtonPressed ();
}
Modal
Modal Types
1. Box: floats on top of the main page and is usually an alert, dialog
box, or menu that the user can respond to or cancel
2. Screen: replaces the main page entirely, interrupting the
hierarchical navigation stack
Modals in Xamarin.Forms
• NavigationPage for full-page modals
• Alerts for user notifications
• Action sheets for pop-up menus
Full Screen Modal
using Push and Pop
• Navigation.PushModalAsync( new nextPage());
• Navigation.PopModalAsync();
Full Screen Modal
using Push and Pop
• Demo: ModalPage
Modal: Alerts
Boolean answer = await DisplayAlert(" Start", "Are you ready to
begin?", "Yes", "No");
Modal: Action Sheets
Button button = new Button { Text = "Show ActionSheet" };
button.Clicked += async (sender, e) =>
{
String action = await DisplayActionSheet("Options",
"Cancel", null, "Here", "There", "Everywhere");
label.Text = "Action is :" + action;
};
Modal: Action Sheets
Modal: Action Sheets
• Demo: PopupMenu
State Management
• Maintain the illusion of continuity during navigation
• Sharing of data between screens
• Pass variables directly into an instantiated ContentPage
Passing Data
Pass data values directly into a page’s constructor
Other ways to pass data between pages:
• Static data instance (global) available to all pages
• Static properties on the Application object
• Static Properties dictionary to persist key/ value pairs to disk
• Application.Current.Properties["id"] = 12345;
Passing Data
Pass data values directly into a page’s constructor
• Demo: DrilldownListViewByItem
Other ways:
• Demo:GlobalPage1, Global
• Demo: PropertiesPage1
Drill-down Lists
• by Item
• by Page
• Grouped
Drill-down Lists
• by Item – use a ListView
• by Page – use a ListView
• Grouped – use a TableView
Use PushAsync when user clicks a row
Drill-down Lists:
NavigationPage
• Wrap list page in a NavigationPage
public class App : Application
{
public App()
{
MainPage = new NavigationPage(new DrilldownListViewByItem
());
}
}
Drill-down Lists
• Demo: DrilldownListViewByItem
• Demo: DrilldownListViewByPage
• Demo: DrilldownTableView
Navigation Drawer
• Demo: MasterDetailPage
• App.cs
• NavigationDrawer.cs
• HomePage.cs
Tabs using TabbedPage
• Static
• Data-bound
• Demos
Springboard:
Images with
Gesture Recognizers
• Roll your own Springboard (demo)
Carousel using CarouselPage
this.Children.Add(new FirstPage());
this.Children.Add(new SecondPage());
this.Children.Add(new ThirdPage());
demo
Xamarin.Forms Navigation
Navigation Pattern Xamarin.Forms Class
Hierarchical NavigationPage
Modal NavigationPage, alerts, and ActionSheets
Drill-down lists NavigationPage, ListView, and TableView
Navigation drawer MasterDetailPage
Tabs TabbedPage
Springboard images with gesture recognizers
Carousel CarouselPage
Xamarin.Android
Navigation
• Hierarchical navigation using Toolbar or ActionBar
• Modal using DialogFragment, AlertDialog, and PopupMenu
• Drill-down list using ListView
• Navigation drawer using DrawerLayout
• Tabs using ActionBar
Xamarin.iOS
Navigation
• Hierarchical navigation using UINavigationController, the push segue,
or the PushViewController
• Modal using the modal segue, the PresentViewController, and
UIAlertAcontroller
• Drill-down list using UINavigationController
• Navigation drawer using components
• Tabs using UITabBarController
It’s all on GitHub
https://github.com/danhermes/xamarin-book-examples
Jesse Liberty’s Video Courses:
Pluralsight.com
• Creating Custom Controls in Xamarin.Forms
• Beginning Automated Testing of Xamarin Applications
• Beginning Mobile Development with Xamarin
• Xamarin.Forms and Data
• XAML for Xamarin.Forms
https://www.pluralsight.com/authors/jesse-liberty
Need Something Xamarin-flavored?
• I do Xamarin consultations
• I do Xamarin coaching and training
• My firm does Xamarin development
• We help make Xamarin projects work
Xamarin Navigation
Patterns
Dan Hermes
developer, author, consultant,
founder of Lexicon Systems
dan@lexiconsystemsinc.com
Available on
Amazon
My blog: www.mobilecsharpcafe.com
Twitter: @danhermes
Ad

More Related Content

Viewers also liked (10)

Extreme (Salesforce) Resume Makeover!
Extreme (Salesforce) Resume Makeover!Extreme (Salesforce) Resume Makeover!
Extreme (Salesforce) Resume Makeover!
Brett Barlow ☁
 
Recruitment Management Systems
Recruitment Management SystemsRecruitment Management Systems
Recruitment Management Systems
MariaVyalkova
 
Mobile Banking Apps with Xamarin
Mobile Banking Apps with XamarinMobile Banking Apps with Xamarin
Mobile Banking Apps with Xamarin
Xpand IT
 
Construindo Aplicativos móveis conectados com Xamarin e Azure Mobile Services
Construindo Aplicativos móveis conectados com Xamarin e Azure Mobile ServicesConstruindo Aplicativos móveis conectados com Xamarin e Azure Mobile Services
Construindo Aplicativos móveis conectados com Xamarin e Azure Mobile Services
William S. Rodriguez
 
Experience
ExperienceExperience
Experience
gueste79ac87c
 
Akash resume
Akash resumeAkash resume
Akash resume
Akash Mishra
 
Civil engineer
Civil engineerCivil engineer
Civil engineer
Nadeer Khan
 
Nishita_SalesForce_ Resume (1)
Nishita_SalesForce_ Resume  (1)Nishita_SalesForce_ Resume  (1)
Nishita_SalesForce_ Resume (1)
Nishita Kansal
 
Experience Letter
Experience LetterExperience Letter
Experience Letter
Arunraj Janakiraman
 
Job Experience Letter Format
Job Experience Letter FormatJob Experience Letter Format
Job Experience Letter Format
Your HR World
 
Extreme (Salesforce) Resume Makeover!
Extreme (Salesforce) Resume Makeover!Extreme (Salesforce) Resume Makeover!
Extreme (Salesforce) Resume Makeover!
Brett Barlow ☁
 
Recruitment Management Systems
Recruitment Management SystemsRecruitment Management Systems
Recruitment Management Systems
MariaVyalkova
 
Mobile Banking Apps with Xamarin
Mobile Banking Apps with XamarinMobile Banking Apps with Xamarin
Mobile Banking Apps with Xamarin
Xpand IT
 
Construindo Aplicativos móveis conectados com Xamarin e Azure Mobile Services
Construindo Aplicativos móveis conectados com Xamarin e Azure Mobile ServicesConstruindo Aplicativos móveis conectados com Xamarin e Azure Mobile Services
Construindo Aplicativos móveis conectados com Xamarin e Azure Mobile Services
William S. Rodriguez
 
Nishita_SalesForce_ Resume (1)
Nishita_SalesForce_ Resume  (1)Nishita_SalesForce_ Resume  (1)
Nishita_SalesForce_ Resume (1)
Nishita Kansal
 
Job Experience Letter Format
Job Experience Letter FormatJob Experience Letter Format
Job Experience Letter Format
Your HR World
 

Similar to Xamarin Navigation Patterns (20)

Xamarin Navigation Patterns
Xamarin Navigation PatternsXamarin Navigation Patterns
Xamarin Navigation Patterns
danhermes
 
Windows Phone 8 - 3 Building WP8 Applications
Windows Phone 8 - 3 Building WP8 ApplicationsWindows Phone 8 - 3 Building WP8 Applications
Windows Phone 8 - 3 Building WP8 Applications
Oliver Scheer
 
Deep Dive into Xamarin.Forms Shell @ Xamarin Summit Brasil 2019
Deep Dive into Xamarin.Forms Shell @ Xamarin Summit Brasil 2019Deep Dive into Xamarin.Forms Shell @ Xamarin Summit Brasil 2019
Deep Dive into Xamarin.Forms Shell @ Xamarin Summit Brasil 2019
Alejandro Ruiz Varela
 
User experience and interactions design
User experience and interactions design User experience and interactions design
User experience and interactions design
Rakesh Jha
 
Diving Into Xamarin.Forms
Diving Into Xamarin.Forms Diving Into Xamarin.Forms
Diving Into Xamarin.Forms
Catapult New Business
 
03.Controls in Windows Phone
03.Controls in Windows Phone03.Controls in Windows Phone
03.Controls in Windows Phone
Nguyen Tuan
 
Navigation in Xamarin.Forms
Navigation in Xamarin.FormsNavigation in Xamarin.Forms
Navigation in Xamarin.Forms
Kym Phillpotts
 
Creating Modern UI PowerBuilder Framework using native objects
Creating Modern UI PowerBuilder Framework using native objectsCreating Modern UI PowerBuilder Framework using native objects
Creating Modern UI PowerBuilder Framework using native objects
zulmach .
 
Native Mobile Testing for Newbies
Native Mobile Testing for NewbiesNative Mobile Testing for Newbies
Native Mobile Testing for Newbies
Susan Hewitt
 
BlackBerry Basic
BlackBerry BasicBlackBerry Basic
BlackBerry Basic
Duy Do Phan
 
Prototyping + User Journeys
Prototyping + User JourneysPrototyping + User Journeys
Prototyping + User Journeys
Fitri Farina Mahat
 
UXPA 2024- Baking Accessibility into Design.pdf
UXPA 2024- Baking Accessibility into Design.pdfUXPA 2024- Baking Accessibility into Design.pdf
UXPA 2024- Baking Accessibility into Design.pdf
Swapnali Thakar
 
##dd12 sviluppo mobile XPages
##dd12 sviluppo mobile XPages##dd12 sviluppo mobile XPages
##dd12 sviluppo mobile XPages
Dominopoint - Italian Lotus User Group
 
Wireless Wednesdays: Beyond the Basics - Enhance your Enterprise Mobile Appli...
Wireless Wednesdays: Beyond the Basics - Enhance your Enterprise Mobile Appli...Wireless Wednesdays: Beyond the Basics - Enhance your Enterprise Mobile Appli...
Wireless Wednesdays: Beyond the Basics - Enhance your Enterprise Mobile Appli...
Teamstudio
 
WordPress Navigation in Responsive Design
WordPress Navigation in Responsive DesignWordPress Navigation in Responsive Design
WordPress Navigation in Responsive Design
openchamp
 
Xamarin.Forms a different approach to cross platform natove mobile development
Xamarin.Forms a different approach to cross platform natove mobile developmentXamarin.Forms a different approach to cross platform natove mobile development
Xamarin.Forms a different approach to cross platform natove mobile development
Dan Ardelean
 
What We Learned From Porting 50+ Cloud Apps to Tizen
What We Learned From Porting 50+ Cloud Apps to TizenWhat We Learned From Porting 50+ Cloud Apps to Tizen
What We Learned From Porting 50+ Cloud Apps to Tizen
Dima Malenko
 
Application Design - Part 2
Application Design - Part 2Application Design - Part 2
Application Design - Part 2
Kelley Howell
 
The XPages Mobile Controls: What's New in Notes 9.0.1
The XPages Mobile Controls: What's New in Notes 9.0.1The XPages Mobile Controls: What's New in Notes 9.0.1
The XPages Mobile Controls: What's New in Notes 9.0.1
Teamstudio
 
NSBudapest Presentation
NSBudapest PresentationNSBudapest Presentation
NSBudapest Presentation
Péter Ádám Wiesner
 
Xamarin Navigation Patterns
Xamarin Navigation PatternsXamarin Navigation Patterns
Xamarin Navigation Patterns
danhermes
 
Windows Phone 8 - 3 Building WP8 Applications
Windows Phone 8 - 3 Building WP8 ApplicationsWindows Phone 8 - 3 Building WP8 Applications
Windows Phone 8 - 3 Building WP8 Applications
Oliver Scheer
 
Deep Dive into Xamarin.Forms Shell @ Xamarin Summit Brasil 2019
Deep Dive into Xamarin.Forms Shell @ Xamarin Summit Brasil 2019Deep Dive into Xamarin.Forms Shell @ Xamarin Summit Brasil 2019
Deep Dive into Xamarin.Forms Shell @ Xamarin Summit Brasil 2019
Alejandro Ruiz Varela
 
User experience and interactions design
User experience and interactions design User experience and interactions design
User experience and interactions design
Rakesh Jha
 
03.Controls in Windows Phone
03.Controls in Windows Phone03.Controls in Windows Phone
03.Controls in Windows Phone
Nguyen Tuan
 
Navigation in Xamarin.Forms
Navigation in Xamarin.FormsNavigation in Xamarin.Forms
Navigation in Xamarin.Forms
Kym Phillpotts
 
Creating Modern UI PowerBuilder Framework using native objects
Creating Modern UI PowerBuilder Framework using native objectsCreating Modern UI PowerBuilder Framework using native objects
Creating Modern UI PowerBuilder Framework using native objects
zulmach .
 
Native Mobile Testing for Newbies
Native Mobile Testing for NewbiesNative Mobile Testing for Newbies
Native Mobile Testing for Newbies
Susan Hewitt
 
BlackBerry Basic
BlackBerry BasicBlackBerry Basic
BlackBerry Basic
Duy Do Phan
 
UXPA 2024- Baking Accessibility into Design.pdf
UXPA 2024- Baking Accessibility into Design.pdfUXPA 2024- Baking Accessibility into Design.pdf
UXPA 2024- Baking Accessibility into Design.pdf
Swapnali Thakar
 
Wireless Wednesdays: Beyond the Basics - Enhance your Enterprise Mobile Appli...
Wireless Wednesdays: Beyond the Basics - Enhance your Enterprise Mobile Appli...Wireless Wednesdays: Beyond the Basics - Enhance your Enterprise Mobile Appli...
Wireless Wednesdays: Beyond the Basics - Enhance your Enterprise Mobile Appli...
Teamstudio
 
WordPress Navigation in Responsive Design
WordPress Navigation in Responsive DesignWordPress Navigation in Responsive Design
WordPress Navigation in Responsive Design
openchamp
 
Xamarin.Forms a different approach to cross platform natove mobile development
Xamarin.Forms a different approach to cross platform natove mobile developmentXamarin.Forms a different approach to cross platform natove mobile development
Xamarin.Forms a different approach to cross platform natove mobile development
Dan Ardelean
 
What We Learned From Porting 50+ Cloud Apps to Tizen
What We Learned From Porting 50+ Cloud Apps to TizenWhat We Learned From Porting 50+ Cloud Apps to Tizen
What We Learned From Porting 50+ Cloud Apps to Tizen
Dima Malenko
 
Application Design - Part 2
Application Design - Part 2Application Design - Part 2
Application Design - Part 2
Kelley Howell
 
The XPages Mobile Controls: What's New in Notes 9.0.1
The XPages Mobile Controls: What's New in Notes 9.0.1The XPages Mobile Controls: What's New in Notes 9.0.1
The XPages Mobile Controls: What's New in Notes 9.0.1
Teamstudio
 
Ad

More from danhermes (9)

Azure Mobile Apps with Xamarin
Azure Mobile Apps with XamarinAzure Mobile Apps with Xamarin
Azure Mobile Apps with Xamarin
danhermes
 
Developing Cross-platform Native Apps with Xamarin
Developing Cross-platform Native Apps with XamarinDeveloping Cross-platform Native Apps with Xamarin
Developing Cross-platform Native Apps with Xamarin
danhermes
 
Building Mobile Apps for Business
Building Mobile Apps for BusinessBuilding Mobile Apps for Business
Building Mobile Apps for Business
danhermes
 
Mobile UI Design Patterns
Mobile UI Design PatternsMobile UI Design Patterns
Mobile UI Design Patterns
danhermes
 
How App Usability, Functionality, and Analysis are Changing with Mobile
  How App Usability, Functionality, and Analysis are Changing with Mobile  How App Usability, Functionality, and Analysis are Changing with Mobile
How App Usability, Functionality, and Analysis are Changing with Mobile
danhermes
 
Cross platform mobile development in c#
Cross platform mobile development in c#Cross platform mobile development in c#
Cross platform mobile development in c#
danhermes
 
What can mobile do for me
What can mobile do for meWhat can mobile do for me
What can mobile do for me
danhermes
 
Agile Development in .NET
Agile Development in .NETAgile Development in .NET
Agile Development in .NET
danhermes
 
Mastering human communication patterns
Mastering human communication patternsMastering human communication patterns
Mastering human communication patterns
danhermes
 
Azure Mobile Apps with Xamarin
Azure Mobile Apps with XamarinAzure Mobile Apps with Xamarin
Azure Mobile Apps with Xamarin
danhermes
 
Developing Cross-platform Native Apps with Xamarin
Developing Cross-platform Native Apps with XamarinDeveloping Cross-platform Native Apps with Xamarin
Developing Cross-platform Native Apps with Xamarin
danhermes
 
Building Mobile Apps for Business
Building Mobile Apps for BusinessBuilding Mobile Apps for Business
Building Mobile Apps for Business
danhermes
 
Mobile UI Design Patterns
Mobile UI Design PatternsMobile UI Design Patterns
Mobile UI Design Patterns
danhermes
 
How App Usability, Functionality, and Analysis are Changing with Mobile
  How App Usability, Functionality, and Analysis are Changing with Mobile  How App Usability, Functionality, and Analysis are Changing with Mobile
How App Usability, Functionality, and Analysis are Changing with Mobile
danhermes
 
Cross platform mobile development in c#
Cross platform mobile development in c#Cross platform mobile development in c#
Cross platform mobile development in c#
danhermes
 
What can mobile do for me
What can mobile do for meWhat can mobile do for me
What can mobile do for me
danhermes
 
Agile Development in .NET
Agile Development in .NETAgile Development in .NET
Agile Development in .NET
danhermes
 
Mastering human communication patterns
Mastering human communication patternsMastering human communication patterns
Mastering human communication patterns
danhermes
 
Ad

Xamarin Navigation Patterns

Editor's Notes

  • #11: Why all the funny names? CROSS PLATFORM terms Inspired in part by by Adam Kemp’s blog post, Navigation in Xamarin.Forms and Mobile Design Pattern Gallery by Theresa Neil @TheRealAdamKemp
  • #12: Why all the funny names? CROSS PLATFORM terms Inspired in part by by Adam Kemp’s blog post, Navigation in Xamarin.Forms and Mobile Design Pattern Gallery by Theresa Neil @TheRealAdamKemp
  • #13: Why all the funny names? CROSS PLATFORM terms Inspired in part by by Adam Kemp’s blog post, Navigation in Xamarin.Forms and Mobile Design Pattern Gallery by Theresa Neil @TheRealAdamKemp
  • #17: Carousel – we’ll get to it. – Doesn’t show well in a static image
  • #19: images
  • #20: Drill-down (push onto stack), pop back up
  • #21: images
  • #24: Dropdown menu - ToolBarItems
  • #27: Single, interruptive pop-up or screen can usually be dismissed with a Cancel button
  • #37: Both the global and Application object techniques use the singleton pattern, and are useful for app-wide classes such as data access or business objects.