SlideShare a Scribd company logo
1 of 41
Download to read offline
Navigation
In Xamarin.Forms
Kym Phillpotts
kphillpotts@gmail.com
@kphillpotts



code & slides: 

https://github.com/kphillpotts/XFNavigation
Topics
Xamarin.Forms Overview
•  Where does Xamarin.Forms fit in?
•  What does the XF framework give you?

Navigation in Xamarin.Forms
•  Push, Pop and Modal
•  Lists Navigation
•  Tabbed Pages
•  Master / Detail Pages
•  Carousel Pages

Additional Resources
•  Design Resources
•  Xamarin Resources
Xamarin.Forms

Overview
Traditional Xamarin Approach
Android
(Platform Specific C#)
iOS
(Platform Specific C#)
Windows
(Platform Specific C#)
Shared C# Backend
(Typically PCL or Shared libraries)
Shared C# Backend
(Typically PCL or Shared libraries)
Shared User Interface Code
Xamarin Forms - C# or XAML
Xamarin Forms Approach
How Xamarin.Forms Renders Controls
Button	
  button	
  =	
  new	
  Button	
  {	
  
	
  	
  	
  Text	
  =	
  "Click	
  Me!"	
  	
  
};	
  
UI uses a Xamarin.Forms Button
Platform Renderer takes view and turns it
into platform-specific control
Android.Widget.Button	
  
UIButton	
  
System.Windows.Button	
  
What’s in the box?
•  Pages
Content Page Master Detail NavigationPage TabbedPage CarouselPage
What’s in the box?
•  Pages
•  Layouts
StackLayout AbsoluteLayout RelativeLayout GridLayout ContentView ScrollView Frame
What’s in the box?
•  Pages
•  Layouts
•  Controls
ActivityIndicator
Entry
BoxView
Image
Button
Label
DatePicker
ListView
Editor
Map
OpenGLView
Stepper
Picker
TableView
ProgressBar
TimePicker
SearchBar
WebView
Slider
EntryCell
ImageCell SwitchCell TextCell ViewCell
Topics
Xamarin.Forms Overview
•  Where does Xamarin.Forms fit in?
•  What does the XF framework give you?

Navigation in Xamarin.Forms
•  NavigationPage
•  Lists Navigation
•  Tabbed Pages
•  Carousel Pages
•  Master / Detail Pages

Additional Resources
•  Design Resources
•  Xamarin Resources
NavigationPage
Navigation Page
Basic Concepts
•  Push pages onto the stack
•  Pop pages off the stack
Hierarchical Navigation
•  PushAsync()
•  PopAsync()
•  PopToRootAsync()
Modal Navigation
•  PushModalAsync()
•  PopModalAsync()
Implementing NavigationPage – Wrap it!
!
!
public App()!
{!
MainPage = new MyPage();!
} !
!
Implementing NavigationPage – Wrap it!
!
!
public App()!
{!
// MainPage = new MyPage();!
MainPage = new NavigationPage(new MyPage());!
} !
!
Hierarchical Navigation
Navigate Forward (Push)
Navigation.PushAsync(new SecondPage());!
!
Navigate Back One Page (Pop)
Navigation.PopAsync();!
!
Navigate Back To First Page (PopToRoot)
Navigation.PopToRoot();!
!
Modal Navigation
Display A Modal Page
Navigation.PushModalAsync(new MyNewModalPage());!
!
Remove A Modal Page
Navigation.PopModalAsync();!
!
GUIDELINES – DO NOT USE SLIDE
Other NavigationPage Goodness
■  Have access to the NavigationStack
-  InsertPage
-  RemovePage
■  BackButtonPressed Events
■  Customizing the navigation bar
-  var navPage = new NavigationPage(new MyPage());
-  navPage.BarBackgroundColor = Color.Green;
-  navPage.BarTextColor = Color.White;
■  NavigationBar Icons
-  NavigationPage.SetTitleIcon(this, “your-logo-here.png");
ListView Navigation
Using ListViews for Navigation
■  Make sure you wrap your ListView page inside a NavigationPage
■  Setup your listview data and bindings (as per normal)
■  Respond to the ItemTapped Event (as per normal)
■  Use the NavigationPage methods to Push to new pages
GUIDELINES – DO NOT USE SLIDE
Other ListView goodness you should check out
■  Pull To Refresh
■  Action Buttons
■  Search Bar
■  Circle Images – Plugin
■  Grouped Lists – James Montemagno
-  http://bit.ly/GroupedListView
TabbedPage
TabbedPage
Basic Concepts
•  Creates a tabbed interface for a collection of
child pages
Platform Differences
•  On iOS Tabs at bottom with icon
•  On Android tabs at the top without icon
•  On Windows Phone uses Pivot control
Implementing TabbedPage
Adding pages to the TabbedPage



public class TabsPage : TabbedPage!
{!
public TabsPage ()!
{!
this.Children.Add (new Page1 () { Title = “Page1", Icon = “Page1.png" });!
this.Children.Add (new Page2 () { Title = “Page2",Icon = “Page2.png" });!
this.Children.Add (new Page3 () { Title = “Page3", Icon = “Page3.png" });!
this.Children.Add (new Page4 () { Title = “Page4", Icon = “Page4.png" });!
}!
}!
!
Navigation inside a TabbedPage
It’s easy, just wrap your children in a NavigationPage



Children.Add ( new NavigationPage (new ChildPage()) !
{!
Title = “PageName", !
Icon = “PageIcon.png" !
});!
!
CarouselPage
Implementing CarouselPage
Adding pages to the CarouselPage



public class FlippyPage : TabbedPage!
{!
public FlippyPage ()!
{!
Children.Add(new BucketItemDetail(buckteItem));!
Children.Add(new BucketItemDetail(buckteItem));!
Children.Add(new BucketItemDetail(buckteItem));!
}!
}!
!
MasterDetailPage
MasterDetailPage
Basic Concepts
•  A container page that manages the 

presentation of two other pages.

•  A master page, which typically shows a list 

or menu of options

•  A detail page, which typically shows the detail
of the selection
Implementing the MasterDetailPage
public class SimpleMasterDetailContainer : MasterDetailPage
{
public SimpleMasterDetailContainer()
{
Master = new SimpleMasterPage();
Detail = new NavigationPage(new SimpleDetailPage());
}
}
Things to Remember with MasterDetailPage
You have to provide a Title in the Master Page, or things go bang!
(optionally you can add an Icon to display – think hamburger icon)
You have to handle the navigation between the master and the
details pages. Do this by setting Detail property

For Tablets you can use MasterBehavior property
•  Default
•  PopOver
•  SplitOnHorizontal
•  SplitOnVertical
Topics
Xamarin.Forms Overview
•  Where does Xamarin.Forms fit in?
•  What does the XF framework give you?

Navigation in Xamarin.Forms
•  Push, Pop and Modal
•  Lists Navigation
•  Tabbed Pages
•  Master / Detail Pages
•  Carousel Pages

Additional Resources
•  Design Resources
•  Xamarin Resources
Design Resources
•  Xamarin.Forms in Anger – Replicating designs in Xamarin.Forms

https://www.syntaxismyui.com/xamarin-forms-in-anger

•  Dribbble – Awesome ideas by bizarrely talented artists

http://dribbble.com

•  UI-Patterns – They why & why nots of UI

http://ui-patterns.com


Xamarin.Forms Dev Resources
•  Xamarin Community blog – Aggregates the best Xamarin blogs

http://planet.xamarin.com/ 

•  Official Xamarin.Forms Website – Links to all the official doco & samples

http://xamarin.com/forms
•  Xamarin-Forms-Labs – Community controls and code

https://github.com/XLabs/Xamarin-Forms-Labs
•  Xamarin Plugins – Awesome nuget plugins that work with Xamarin.Forms
•  https://github.com/xamarin/plugins
•  Free Charles Petzold Xamarin Forms eBook 

http://bit.ly/PetzoldBook





THANKS
(and questions)
Kym Phillpotts
kphillpotts@gmail.com
@kphillpotts



code & slides: 

https://github.com/kphillpotts/XFNavigation

More Related Content

Viewers also liked

10 Awesome Xamarin.Forms Tips & Tricks
10 Awesome Xamarin.Forms Tips & Tricks10 Awesome Xamarin.Forms Tips & Tricks
10 Awesome Xamarin.Forms Tips & TricksMichael Ridland
 
Native cross-platform mobile apps with C# and Xamarin.Forms
Native cross-platform mobile apps with C# and Xamarin.FormsNative cross-platform mobile apps with C# and Xamarin.Forms
Native cross-platform mobile apps with C# and Xamarin.FormsPeter Major
 
Your First Xamarin.Forms App
Your First Xamarin.Forms AppYour First Xamarin.Forms App
Your First Xamarin.Forms AppCraig Dunn
 
Xamarin Navigation Patterns
Xamarin Navigation PatternsXamarin Navigation Patterns
Xamarin Navigation Patternsdanhermes
 
[XamarinDay] Développez de manière 100% native avec Xamarin
[XamarinDay] Développez de manière 100% native avec Xamarin[XamarinDay] Développez de manière 100% native avec Xamarin
[XamarinDay] Développez de manière 100% native avec XamarinCellenza
 
Dotnetconf - Introduction to Xamarin and Xamarin.Forms
Dotnetconf - Introduction to Xamarin and Xamarin.FormsDotnetconf - Introduction to Xamarin and Xamarin.Forms
Dotnetconf - Introduction to Xamarin and Xamarin.FormsJames Montemagno
 
Visual Studio Toolbox - Introduction To Xamarin.Forms
Visual Studio Toolbox - Introduction To Xamarin.FormsVisual Studio Toolbox - Introduction To Xamarin.Forms
Visual Studio Toolbox - Introduction To Xamarin.FormsJames Montemagno
 
DevDay Salerno - Introduzione a Xamarin
DevDay Salerno - Introduzione a XamarinDevDay Salerno - Introduzione a Xamarin
DevDay Salerno - Introduzione a XamarinAntonio Liccardi
 
Developing and Designing Native Mobile Apps in Visual Studio
Developing and Designing Native Mobile Apps in Visual StudioDeveloping and Designing Native Mobile Apps in Visual Studio
Developing and Designing Native Mobile Apps in Visual StudioXamarin
 
[XamarinDay] Développez en XAML avec Xamarin Forms
[XamarinDay] Développez en XAML avec Xamarin Forms[XamarinDay] Développez en XAML avec Xamarin Forms
[XamarinDay] Développez en XAML avec Xamarin FormsCellenza
 
Interfaces nativas Cross-Platform con Xamarin.Forms
Interfaces nativas Cross-Platform con Xamarin.FormsInterfaces nativas Cross-Platform con Xamarin.Forms
Interfaces nativas Cross-Platform con Xamarin.FormsJavier Suárez Ruiz
 
Introduction to Xamarin 2.0
Introduction to Xamarin 2.0Introduction to Xamarin 2.0
Introduction to Xamarin 2.0Xamarin
 
Building Your First Android App with Xamarin
Building Your First Android App with XamarinBuilding Your First Android App with Xamarin
Building Your First Android App with XamarinXamarin
 
Xamarin Mobile Leaders Summit: The Mobile Mind Shift: Opportunities, Challeng...
Xamarin Mobile Leaders Summit: The Mobile Mind Shift: Opportunities, Challeng...Xamarin Mobile Leaders Summit: The Mobile Mind Shift: Opportunities, Challeng...
Xamarin Mobile Leaders Summit: The Mobile Mind Shift: Opportunities, Challeng...Xamarin
 
Intro to Xamarin for Visual Studio: Native iOS, Android, and Windows Apps in C#
Intro to Xamarin for Visual Studio: Native iOS, Android, and Windows Apps in C#Intro to Xamarin for Visual Studio: Native iOS, Android, and Windows Apps in C#
Intro to Xamarin for Visual Studio: Native iOS, Android, and Windows Apps in C#Xamarin
 
Native i os, android, and windows development in c# with xamarin 4
Native i os, android, and windows development in c# with xamarin 4Native i os, android, and windows development in c# with xamarin 4
Native i os, android, and windows development in c# with xamarin 4Xamarin
 

Viewers also liked (20)

10 Awesome Xamarin.Forms Tips & Tricks
10 Awesome Xamarin.Forms Tips & Tricks10 Awesome Xamarin.Forms Tips & Tricks
10 Awesome Xamarin.Forms Tips & Tricks
 
Native cross-platform mobile apps with C# and Xamarin.Forms
Native cross-platform mobile apps with C# and Xamarin.FormsNative cross-platform mobile apps with C# and Xamarin.Forms
Native cross-platform mobile apps with C# and Xamarin.Forms
 
Your First Xamarin.Forms App
Your First Xamarin.Forms AppYour First Xamarin.Forms App
Your First Xamarin.Forms App
 
Trabajo Final de Grado - Arctic
Trabajo Final de Grado - ArcticTrabajo Final de Grado - Arctic
Trabajo Final de Grado - Arctic
 
Xamarin Navigation Patterns
Xamarin Navigation PatternsXamarin Navigation Patterns
Xamarin Navigation Patterns
 
[XamarinDay] Développez de manière 100% native avec Xamarin
[XamarinDay] Développez de manière 100% native avec Xamarin[XamarinDay] Développez de manière 100% native avec Xamarin
[XamarinDay] Développez de manière 100% native avec Xamarin
 
Xamarin Forms
Xamarin FormsXamarin Forms
Xamarin Forms
 
Dotnetconf - Introduction to Xamarin and Xamarin.Forms
Dotnetconf - Introduction to Xamarin and Xamarin.FormsDotnetconf - Introduction to Xamarin and Xamarin.Forms
Dotnetconf - Introduction to Xamarin and Xamarin.Forms
 
Visual Studio Toolbox - Introduction To Xamarin.Forms
Visual Studio Toolbox - Introduction To Xamarin.FormsVisual Studio Toolbox - Introduction To Xamarin.Forms
Visual Studio Toolbox - Introduction To Xamarin.Forms
 
DevDay Salerno - Introduzione a Xamarin
DevDay Salerno - Introduzione a XamarinDevDay Salerno - Introduzione a Xamarin
DevDay Salerno - Introduzione a Xamarin
 
Developing and Designing Native Mobile Apps in Visual Studio
Developing and Designing Native Mobile Apps in Visual StudioDeveloping and Designing Native Mobile Apps in Visual Studio
Developing and Designing Native Mobile Apps in Visual Studio
 
Introduction to xamarin
Introduction to xamarinIntroduction to xamarin
Introduction to xamarin
 
Xamarin.Forms
Xamarin.FormsXamarin.Forms
Xamarin.Forms
 
[XamarinDay] Développez en XAML avec Xamarin Forms
[XamarinDay] Développez en XAML avec Xamarin Forms[XamarinDay] Développez en XAML avec Xamarin Forms
[XamarinDay] Développez en XAML avec Xamarin Forms
 
Interfaces nativas Cross-Platform con Xamarin.Forms
Interfaces nativas Cross-Platform con Xamarin.FormsInterfaces nativas Cross-Platform con Xamarin.Forms
Interfaces nativas Cross-Platform con Xamarin.Forms
 
Introduction to Xamarin 2.0
Introduction to Xamarin 2.0Introduction to Xamarin 2.0
Introduction to Xamarin 2.0
 
Building Your First Android App with Xamarin
Building Your First Android App with XamarinBuilding Your First Android App with Xamarin
Building Your First Android App with Xamarin
 
Xamarin Mobile Leaders Summit: The Mobile Mind Shift: Opportunities, Challeng...
Xamarin Mobile Leaders Summit: The Mobile Mind Shift: Opportunities, Challeng...Xamarin Mobile Leaders Summit: The Mobile Mind Shift: Opportunities, Challeng...
Xamarin Mobile Leaders Summit: The Mobile Mind Shift: Opportunities, Challeng...
 
Intro to Xamarin for Visual Studio: Native iOS, Android, and Windows Apps in C#
Intro to Xamarin for Visual Studio: Native iOS, Android, and Windows Apps in C#Intro to Xamarin for Visual Studio: Native iOS, Android, and Windows Apps in C#
Intro to Xamarin for Visual Studio: Native iOS, Android, and Windows Apps in C#
 
Native i os, android, and windows development in c# with xamarin 4
Native i os, android, and windows development in c# with xamarin 4Native i os, android, and windows development in c# with xamarin 4
Native i os, android, and windows development in c# with xamarin 4
 

Similar to Navigation in Xamarin.Forms

From a Fireworks Comp to a Genesis Child Theme, Step by Step
From a Fireworks Comp to a Genesis Child Theme, Step by StepFrom a Fireworks Comp to a Genesis Child Theme, Step by Step
From a Fireworks Comp to a Genesis Child Theme, Step by StepEast Bay WordPress Meetup
 
Xamarin Navigation Patterns
Xamarin Navigation PatternsXamarin Navigation Patterns
Xamarin Navigation Patternsdanhermes
 
Twitter Bootstrap (spring)
Twitter Bootstrap (spring)Twitter Bootstrap (spring)
Twitter Bootstrap (spring)darbyfrey
 
Twitter Bootstrap
Twitter BootstrapTwitter Bootstrap
Twitter Bootstrapdarbyfrey
 
WordPress HTML, CSS & Child Themes
WordPress HTML, CSS & Child ThemesWordPress HTML, CSS & Child Themes
WordPress HTML, CSS & Child ThemesMichelle Ames
 
Using MapBasic to modify your user interface
Using MapBasic to modify your user interfaceUsing MapBasic to modify your user interface
Using MapBasic to modify your user interfacePeter Horsbøll Møller
 
.NET Fest 2017. Matteo Pagani. Prism and Xamarin Forms: create cross-platform...
.NET Fest 2017. Matteo Pagani. Prism and Xamarin Forms: create cross-platform....NET Fest 2017. Matteo Pagani. Prism and Xamarin Forms: create cross-platform...
.NET Fest 2017. Matteo Pagani. Prism and Xamarin Forms: create cross-platform...NETFest
 
Introduction to Drupal (7) Theming
Introduction to Drupal (7) ThemingIntroduction to Drupal (7) Theming
Introduction to Drupal (7) ThemingRobert Carr
 
Advanced MVVM Windows UWP apps with Template 10
Advanced MVVM Windows UWP apps with Template 10Advanced MVVM Windows UWP apps with Template 10
Advanced MVVM Windows UWP apps with Template 10Jiri Danihelka
 
Intro to Theming Drupal, FOSSLC Summer Camp 2010
Intro to Theming Drupal, FOSSLC Summer Camp 2010Intro to Theming Drupal, FOSSLC Summer Camp 2010
Intro to Theming Drupal, FOSSLC Summer Camp 2010Emma Jane Hogbin Westby
 
Face/Off: APEX Templates & Themes
Face/Off: APEX Templates & ThemesFace/Off: APEX Templates & Themes
Face/Off: APEX Templates & Themescrokitta
 
I have created my website….now what?
I have created my website….now what?I have created my website….now what?
I have created my website….now what?LoudClick.net
 
NetObjects Fusion 2015 Manual Book
NetObjects Fusion 2015 Manual BookNetObjects Fusion 2015 Manual Book
NetObjects Fusion 2015 Manual BookBrandon Taylor
 
UX01 Customization Tour Of SharePoint - APAC Conference Sydney - 2007
UX01 Customization Tour Of SharePoint - APAC Conference Sydney - 2007UX01 Customization Tour Of SharePoint - APAC Conference Sydney - 2007
UX01 Customization Tour Of SharePoint - APAC Conference Sydney - 2007Chandima Kulathilake
 
Bootstrap Web Development Framework
Bootstrap Web Development FrameworkBootstrap Web Development Framework
Bootstrap Web Development FrameworkCindy Royal
 
Designing well known websites with ADF Rich Faces
Designing well known websites with ADF Rich FacesDesigning well known websites with ADF Rich Faces
Designing well known websites with ADF Rich Facesmaikorocha
 
Android and IOS UI Development (Android 5.0 and iOS 9.0)
Android and IOS UI Development (Android 5.0 and iOS 9.0)Android and IOS UI Development (Android 5.0 and iOS 9.0)
Android and IOS UI Development (Android 5.0 and iOS 9.0)Michael Shrove
 

Similar to Navigation in Xamarin.Forms (20)

From a Fireworks Comp to a Genesis Child Theme, Step by Step
From a Fireworks Comp to a Genesis Child Theme, Step by StepFrom a Fireworks Comp to a Genesis Child Theme, Step by Step
From a Fireworks Comp to a Genesis Child Theme, Step by Step
 
Xamarin Navigation Patterns
Xamarin Navigation PatternsXamarin Navigation Patterns
Xamarin Navigation Patterns
 
Webexpration2007 ii
Webexpration2007 iiWebexpration2007 ii
Webexpration2007 ii
 
Twitter Bootstrap (spring)
Twitter Bootstrap (spring)Twitter Bootstrap (spring)
Twitter Bootstrap (spring)
 
Twitter Bootstrap
Twitter BootstrapTwitter Bootstrap
Twitter Bootstrap
 
WordPress HTML, CSS & Child Themes
WordPress HTML, CSS & Child ThemesWordPress HTML, CSS & Child Themes
WordPress HTML, CSS & Child Themes
 
Using MapBasic to modify your user interface
Using MapBasic to modify your user interfaceUsing MapBasic to modify your user interface
Using MapBasic to modify your user interface
 
.NET Fest 2017. Matteo Pagani. Prism and Xamarin Forms: create cross-platform...
.NET Fest 2017. Matteo Pagani. Prism and Xamarin Forms: create cross-platform....NET Fest 2017. Matteo Pagani. Prism and Xamarin Forms: create cross-platform...
.NET Fest 2017. Matteo Pagani. Prism and Xamarin Forms: create cross-platform...
 
Introduction to Drupal (7) Theming
Introduction to Drupal (7) ThemingIntroduction to Drupal (7) Theming
Introduction to Drupal (7) Theming
 
Advanced MVVM Windows UWP apps with Template 10
Advanced MVVM Windows UWP apps with Template 10Advanced MVVM Windows UWP apps with Template 10
Advanced MVVM Windows UWP apps with Template 10
 
Boot strap
Boot strapBoot strap
Boot strap
 
Intro to Theming Drupal, FOSSLC Summer Camp 2010
Intro to Theming Drupal, FOSSLC Summer Camp 2010Intro to Theming Drupal, FOSSLC Summer Camp 2010
Intro to Theming Drupal, FOSSLC Summer Camp 2010
 
Face/Off: APEX Templates & Themes
Face/Off: APEX Templates & ThemesFace/Off: APEX Templates & Themes
Face/Off: APEX Templates & Themes
 
I have created my website….now what?
I have created my website….now what?I have created my website….now what?
I have created my website….now what?
 
NetObjects Fusion 2015 Manual Book
NetObjects Fusion 2015 Manual BookNetObjects Fusion 2015 Manual Book
NetObjects Fusion 2015 Manual Book
 
UX01 Customization Tour Of SharePoint - APAC Conference Sydney - 2007
UX01 Customization Tour Of SharePoint - APAC Conference Sydney - 2007UX01 Customization Tour Of SharePoint - APAC Conference Sydney - 2007
UX01 Customization Tour Of SharePoint - APAC Conference Sydney - 2007
 
Bootstrap Web Development Framework
Bootstrap Web Development FrameworkBootstrap Web Development Framework
Bootstrap Web Development Framework
 
Slice and Dice
Slice and DiceSlice and Dice
Slice and Dice
 
Designing well known websites with ADF Rich Faces
Designing well known websites with ADF Rich FacesDesigning well known websites with ADF Rich Faces
Designing well known websites with ADF Rich Faces
 
Android and IOS UI Development (Android 5.0 and iOS 9.0)
Android and IOS UI Development (Android 5.0 and iOS 9.0)Android and IOS UI Development (Android 5.0 and iOS 9.0)
Android and IOS UI Development (Android 5.0 and iOS 9.0)
 

More from Kym Phillpotts

Creating Great Xamarin.Forms UI's
Creating Great Xamarin.Forms UI'sCreating Great Xamarin.Forms UI's
Creating Great Xamarin.Forms UI'sKym Phillpotts
 
Microsoft Build recap for Xamarin developers
Microsoft Build recap for Xamarin developersMicrosoft Build recap for Xamarin developers
Microsoft Build recap for Xamarin developersKym Phillpotts
 
An introduction to Xamarin layout and navigation - Dev Days Melbourne 2017
An introduction to Xamarin layout and navigation - Dev Days Melbourne 2017An introduction to Xamarin layout and navigation - Dev Days Melbourne 2017
An introduction to Xamarin layout and navigation - Dev Days Melbourne 2017Kym Phillpotts
 
Customising Xamarin.Forms
Customising Xamarin.FormsCustomising Xamarin.Forms
Customising Xamarin.FormsKym Phillpotts
 
Location Based Development Using Xamarin
Location Based Development Using XamarinLocation Based Development Using Xamarin
Location Based Development Using XamarinKym Phillpotts
 

More from Kym Phillpotts (6)

Creating Great Xamarin.Forms UI's
Creating Great Xamarin.Forms UI'sCreating Great Xamarin.Forms UI's
Creating Great Xamarin.Forms UI's
 
Microsoft Build recap for Xamarin developers
Microsoft Build recap for Xamarin developersMicrosoft Build recap for Xamarin developers
Microsoft Build recap for Xamarin developers
 
Xamarin tools
Xamarin toolsXamarin tools
Xamarin tools
 
An introduction to Xamarin layout and navigation - Dev Days Melbourne 2017
An introduction to Xamarin layout and navigation - Dev Days Melbourne 2017An introduction to Xamarin layout and navigation - Dev Days Melbourne 2017
An introduction to Xamarin layout and navigation - Dev Days Melbourne 2017
 
Customising Xamarin.Forms
Customising Xamarin.FormsCustomising Xamarin.Forms
Customising Xamarin.Forms
 
Location Based Development Using Xamarin
Location Based Development Using XamarinLocation Based Development Using Xamarin
Location Based Development Using Xamarin
 

Recently uploaded

TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024Lonnie McRorey
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxLoriGlavin3
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity PlanDatabarracks
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Mark Simos
 
Search Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfSearch Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfRankYa
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupFlorian Wilhelm
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsPixlogix Infotech
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr BaganFwdays
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Enterprise Knowledge
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsRizwan Syed
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek SchlawackFwdays
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.Curtis Poe
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Scott Keck-Warren
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Manik S Magar
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionDilum Bandara
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):comworks
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii SoldatenkoFwdays
 

Recently uploaded (20)

TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity Plan
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
 
Search Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfSearch Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdf
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project Setup
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and Cons
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024
 
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptxE-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL Certs
 
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An Introduction
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko
 

Navigation in Xamarin.Forms

  • 1. Navigation In Xamarin.Forms Kym Phillpotts kphillpotts@gmail.com @kphillpotts
 
 code & slides: 
 https://github.com/kphillpotts/XFNavigation
  • 2. Topics Xamarin.Forms Overview •  Where does Xamarin.Forms fit in? •  What does the XF framework give you?
 Navigation in Xamarin.Forms •  Push, Pop and Modal •  Lists Navigation •  Tabbed Pages •  Master / Detail Pages •  Carousel Pages
 Additional Resources •  Design Resources •  Xamarin Resources
  • 4. Traditional Xamarin Approach Android (Platform Specific C#) iOS (Platform Specific C#) Windows (Platform Specific C#) Shared C# Backend (Typically PCL or Shared libraries)
  • 5. Shared C# Backend (Typically PCL or Shared libraries) Shared User Interface Code Xamarin Forms - C# or XAML Xamarin Forms Approach
  • 6. How Xamarin.Forms Renders Controls Button  button  =  new  Button  {        Text  =  "Click  Me!"     };   UI uses a Xamarin.Forms Button Platform Renderer takes view and turns it into platform-specific control Android.Widget.Button   UIButton   System.Windows.Button  
  • 7. What’s in the box? •  Pages Content Page Master Detail NavigationPage TabbedPage CarouselPage
  • 8. What’s in the box? •  Pages •  Layouts StackLayout AbsoluteLayout RelativeLayout GridLayout ContentView ScrollView Frame
  • 9. What’s in the box? •  Pages •  Layouts •  Controls ActivityIndicator Entry BoxView Image Button Label DatePicker ListView Editor Map OpenGLView Stepper Picker TableView ProgressBar TimePicker SearchBar WebView Slider EntryCell ImageCell SwitchCell TextCell ViewCell
  • 10. Topics Xamarin.Forms Overview •  Where does Xamarin.Forms fit in? •  What does the XF framework give you?
 Navigation in Xamarin.Forms •  NavigationPage •  Lists Navigation •  Tabbed Pages •  Carousel Pages •  Master / Detail Pages
 Additional Resources •  Design Resources •  Xamarin Resources
  • 12. Navigation Page Basic Concepts •  Push pages onto the stack •  Pop pages off the stack Hierarchical Navigation •  PushAsync() •  PopAsync() •  PopToRootAsync() Modal Navigation •  PushModalAsync() •  PopModalAsync()
  • 13. Implementing NavigationPage – Wrap it! ! ! public App()! {! MainPage = new MyPage();! } ! !
  • 14. Implementing NavigationPage – Wrap it! ! ! public App()! {! // MainPage = new MyPage();! MainPage = new NavigationPage(new MyPage());! } ! !
  • 15. Hierarchical Navigation Navigate Forward (Push) Navigation.PushAsync(new SecondPage());! ! Navigate Back One Page (Pop) Navigation.PopAsync();! ! Navigate Back To First Page (PopToRoot) Navigation.PopToRoot();! !
  • 16. Modal Navigation Display A Modal Page Navigation.PushModalAsync(new MyNewModalPage());! ! Remove A Modal Page Navigation.PopModalAsync();! !
  • 17. GUIDELINES – DO NOT USE SLIDE
  • 18. Other NavigationPage Goodness ■  Have access to the NavigationStack -  InsertPage -  RemovePage ■  BackButtonPressed Events ■  Customizing the navigation bar -  var navPage = new NavigationPage(new MyPage()); -  navPage.BarBackgroundColor = Color.Green; -  navPage.BarTextColor = Color.White; ■  NavigationBar Icons -  NavigationPage.SetTitleIcon(this, “your-logo-here.png");
  • 20. Using ListViews for Navigation ■  Make sure you wrap your ListView page inside a NavigationPage ■  Setup your listview data and bindings (as per normal) ■  Respond to the ItemTapped Event (as per normal) ■  Use the NavigationPage methods to Push to new pages
  • 21. GUIDELINES – DO NOT USE SLIDE
  • 22. Other ListView goodness you should check out ■  Pull To Refresh ■  Action Buttons ■  Search Bar ■  Circle Images – Plugin ■  Grouped Lists – James Montemagno -  http://bit.ly/GroupedListView
  • 24. TabbedPage Basic Concepts •  Creates a tabbed interface for a collection of child pages Platform Differences •  On iOS Tabs at bottom with icon •  On Android tabs at the top without icon •  On Windows Phone uses Pivot control
  • 25.
  • 26. Implementing TabbedPage Adding pages to the TabbedPage
 
 public class TabsPage : TabbedPage! {! public TabsPage ()! {! this.Children.Add (new Page1 () { Title = “Page1", Icon = “Page1.png" });! this.Children.Add (new Page2 () { Title = “Page2",Icon = “Page2.png" });! this.Children.Add (new Page3 () { Title = “Page3", Icon = “Page3.png" });! this.Children.Add (new Page4 () { Title = “Page4", Icon = “Page4.png" });! }! }! !
  • 27. Navigation inside a TabbedPage It’s easy, just wrap your children in a NavigationPage
 
 Children.Add ( new NavigationPage (new ChildPage()) ! {! Title = “PageName", ! Icon = “PageIcon.png" ! });! !
  • 28.
  • 30.
  • 31. Implementing CarouselPage Adding pages to the CarouselPage
 
 public class FlippyPage : TabbedPage! {! public FlippyPage ()! {! Children.Add(new BucketItemDetail(buckteItem));! Children.Add(new BucketItemDetail(buckteItem));! Children.Add(new BucketItemDetail(buckteItem));! }! }! !
  • 32.
  • 34. MasterDetailPage Basic Concepts •  A container page that manages the 
 presentation of two other pages.
 •  A master page, which typically shows a list 
 or menu of options
 •  A detail page, which typically shows the detail of the selection
  • 35. Implementing the MasterDetailPage public class SimpleMasterDetailContainer : MasterDetailPage { public SimpleMasterDetailContainer() { Master = new SimpleMasterPage(); Detail = new NavigationPage(new SimpleDetailPage()); } }
  • 36. Things to Remember with MasterDetailPage You have to provide a Title in the Master Page, or things go bang! (optionally you can add an Icon to display – think hamburger icon) You have to handle the navigation between the master and the details pages. Do this by setting Detail property
 For Tablets you can use MasterBehavior property •  Default •  PopOver •  SplitOnHorizontal •  SplitOnVertical
  • 37.
  • 38. Topics Xamarin.Forms Overview •  Where does Xamarin.Forms fit in? •  What does the XF framework give you?
 Navigation in Xamarin.Forms •  Push, Pop and Modal •  Lists Navigation •  Tabbed Pages •  Master / Detail Pages •  Carousel Pages
 Additional Resources •  Design Resources •  Xamarin Resources
  • 39. Design Resources •  Xamarin.Forms in Anger – Replicating designs in Xamarin.Forms
 https://www.syntaxismyui.com/xamarin-forms-in-anger
 •  Dribbble – Awesome ideas by bizarrely talented artists
 http://dribbble.com
 •  UI-Patterns – They why & why nots of UI
 http://ui-patterns.com 

  • 40. Xamarin.Forms Dev Resources •  Xamarin Community blog – Aggregates the best Xamarin blogs
 http://planet.xamarin.com/ 
 •  Official Xamarin.Forms Website – Links to all the official doco & samples
 http://xamarin.com/forms •  Xamarin-Forms-Labs – Community controls and code
 https://github.com/XLabs/Xamarin-Forms-Labs •  Xamarin Plugins – Awesome nuget plugins that work with Xamarin.Forms •  https://github.com/xamarin/plugins •  Free Charles Petzold Xamarin Forms eBook 
 http://bit.ly/PetzoldBook
 
 

  • 41. THANKS (and questions) Kym Phillpotts kphillpotts@gmail.com @kphillpotts
 
 code & slides: 
 https://github.com/kphillpotts/XFNavigation