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

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 Step
East Bay WordPress Meetup
 
Twitter Bootstrap (spring)
Twitter Bootstrap (spring)Twitter Bootstrap (spring)
Twitter Bootstrap (spring)
darbyfrey
 
Twitter Bootstrap
Twitter BootstrapTwitter Bootstrap
Twitter Bootstrap
darbyfrey
 
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
Emma Jane Hogbin Westby
 
NetObjects Fusion 2015 Manual Book
NetObjects Fusion 2015 Manual BookNetObjects Fusion 2015 Manual Book
NetObjects Fusion 2015 Manual Book
Brandon Taylor
 
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

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

IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
Enterprise Knowledge
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
giselly40
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
vu2urc
 

Recently uploaded (20)

IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
Evaluating the top large language models.pdf
Evaluating the top large language models.pdfEvaluating the top large language models.pdf
Evaluating the top large language models.pdf
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 

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