SlideShare a Scribd company logo
Say Hello To Xamarin.Forms
Nish Anil
@nishanil | nish@xamarin.com
Traditional Xamarin Development
Using the Native UI SDKs
■
Build native UIs
■
UIKit & Storyboards on iOS
■
AXML for Android
■
XAML for Windows Phone
■
Write shared C# code
■
Database, Web Services
■
Business Logic
■
Share 60-80% of the code
UIKit Layout XAML
Using Xamarin.Forms
Shared UI Code!
To Build the User Interface
■
Use the same strategies for sharing
■
Database, Web Services
■
Business Logic
■
Build the UI with a single shared
codebase
■
Share 99% of the code
UIKit Layout XAML
Using Xamarin.Forms
Shared UI Code!
■
Code sharing/re-use
■
Native look and feel
■
Access to native SDKs using Custom
Renderers and DependencyService
■
Camera, accelerometer, GPS,
■
NFC & more on Android
■
PassKit & more on iOS
■
Tiles & more on Windows Phone
Benefits UIKit Layout XAML
Shared C# User Interface Code
Meet Xamarin.Forms
Build native UIs for iOS, Android and Windows Phone
from a single, shared C# codebase.
Meet Xamarin.Forms
Build native UIs for iOS, Android and Windows Phone
from a single, shared C# codebase.
Meet Xamarin.Forms
Build native UIs for iOS, Android and Windows Phone
from a single, shared C# codebase.
Meet Xamarin.Forms
Build native UIs for iOS, Android and Windows Phone
from a single, shared C# codebase.
Meet Xamarin.Forms
Build native UIs for iOS, Android and Windows Phone
from a single, shared C# codebase.
Meet Xamarin.Forms
Build native UIs for iOS, Android and Windows Phone
from a single, shared C# codebase.
Meet Xamarin.Forms
public class HelloWorld : ContentPage

{

public HelloWorld ()

{

var button = new Button
{ Text = "Say Hello" } ;

button.Clicked += SayHelloClicked;

Content = new StackLayout {

new Label { Text = "Hello World" } ,

button

};

}
void SayHelloClicked (object s, EventArgs e)

{

// do something

}

}

<?xml version="1.0" encoding="UTF-8"?>

<ContentPage xmlns="http://xamarin.com/schemas/2014/fo
x:Class="HelloForms.HelloWorld">

<StackLayout>

<Label Text="Hello World" />

<Button Text="Say Hello"
OnClick="SayHelloClicked" />

</StackLayout>

</ContentPage>



public partial class HelloWorld : ContentPage
{

public HelloWorld ()
{

InitializeComponent ();

}

void SayHelloClicked (object s, EventArgs e)
{

// do something

}

}
C# XAML
Demo
■
File > New Project
■
Create a screen
■
Add some code
■
Run on iOS, Android, 

& Windows Phone
APAC Webinar: Say Hello To Xamarin.Forms
How Xamarin.Forms works
Anatomy of a Xamarin.Forms Solution
■
PCL or Shared Project
How Xamarin.Forms works
Anatomy of a Xamarin.Forms Solution
■
PCL or Shared Project
■
NuGet Package
How Xamarin.Forms works
Anatomy of a Xamarin.Forms Solution
■
PCL or Shared Project
■
NuGet Package
■
App Class
How Xamarin.Forms works
Anatomy of a Xamarin.Forms Solution
■
PCL or Shared Project
■
NuGet Package
■
App Class
■
Android app
How Xamarin.Forms works
Anatomy of a Xamarin.Forms Solution
■
PCL or Shared Project
■
NuGet Package
■
App Class
■
Android app
■
iOS app
How Xamarin.Forms works
Anatomy of a Xamarin.Forms Solution
■
PCL or Shared Project
■
NuGet Package
■
App Class
■
Android app
■
iOS app
■
Windows Phone app
Platform Renderers
Taking Xamarin.Forms UI to the people (devices)
?
?
?
Platform Renderers
Taking Xamarin.Forms UI to the people
Platform Renderers
Taking Xamarin.Forms UI to the people
Platform Renderers
Taking Xamarin.Forms UI to the people
Xamarin.Forms brings common UX to everyone
iOS does not have a native control
for the iPhone, however
Xamarin.Forms uses
UISplitViewController on iPad.
Android has a native 'drawer'
control which Xamarin.Forms uses.
Windows Phone doesn’t have a
comparable UI metaphor, so
Xamarin.Forms provides an
implementation.
MasterDetailPage
Xamarin.Forms brings common UX to everyone
iOS has the UINavigationController
which Xamarin.Forms leverages.
Android has the navigation stack
built in, but Xamarin.Forms adds
the automatic 'back' button for API
consistency.
Windows Phone also has a back-
stack with hardware button, so
Xamarin.Forms takes advantage of
that.
NavigationPage
140+ new Controls!
http://components.xamarin.com
From our Partners!
Demo
■
Write Platform Specific Code
Dependency Service
Easily call into platform-specific code
■
In the common code
■
Code to an Interface
public interface ITextToSpeech

{

void Speak (string text);

}
Dependency Service
Easily call into platform-specific code
■
In the common code
■
Code to an Interface
■
Use DependencyService
public interface ITextToSpeech

{

void Speak (string text);

}
DependencyService.Get<ITextToSpeech>().Speak("Hello from Xamarin Forms");

Dependency Service
Easily call into platform-specific code
■
In the common code
■
Code to an Interface
■
Use DependencyService
■
For each platform
■
implement the Interface
[assembly: Xamarin.Forms.Dependency (typeof (Speech))]


public class Speech : ITextToSpeech

{

public Speech () { }

public void Speak (string text)

{

var speechSynthesizer = new AVSpeechSynthesizer ();

var speechUtterance = new AVSpeechUtterance (text) {

Rate = AVSpeechUtterance.MaximumSpeechRate/4,

Voice = AVSpeechSynthesisVoice.FromLanguage ("en-US"),

Volume = 0.5f,

PitchMultiplier = 1.0f

} ;

speechSynthesizer.SpeakUtterance (speechUtterance);

}

}
Dependency Service
Easily call into platform-specific code
■
In the common code
■
Code to an Interface
■
Use DependencyService
■
For each platform
■
implement the Interface
■
use Dependency
attribute on the
assembly
[assembly: Xamarin.Forms.Dependency (typeof (Speech))]


public class Speech : ITextToSpeech

{

public Speech () { }

public void Speak (string text)

{

var speechSynthesizer = new AVSpeechSynthesizer ();

var speechUtterance = new AVSpeechUtterance (text) {

Rate = AVSpeechUtterance.MaximumSpeechRate/4,

Voice = AVSpeechSynthesisVoice.FromLanguage ("en-US"),

Volume = 0.5f,

PitchMultiplier = 1.0f

} ;

speechSynthesizer.SpeakUtterance (speechUtterance);

}

}
Data Binding
Sync views and models
■
Enables MVVM-style development
■
SetBinding in C#
■
{Binding} in XAML
■
also supports the Command pattern
Custom Renderers
Extend or Create Xamarin.Forms Controls
■
Subclass the built-in Platform Renderers
■
Build your own Xamarin.Forms

control and renderers

(eg. OxyPlot)
Further Reading…
■
developer.xamarin.com
■
forums.xamarin.com
■
Creating Mobile Apps with
Xamarin.Forms - Charles Petzold

Available as a FREE download
Thanks!
Nish Anil
@nishanil | nish@xamarin.com

More Related Content

PPTX
[MobConf] Go mobile with C#, Visual Studio & Xamarin
PDF
Introduction to CocosSharp
PDF
Deep Dive in Xamarin.Forms
PPTX
.Net Standard Libraries and Xamarin
PPTX
Xamarin for iOS developers
PDF
Xamarin 4 - the future of apps
PDF
iOS & Android Dev in C# & Visual Studio using Xamarin
PPTX
Introduction to Xamarin
[MobConf] Go mobile with C#, Visual Studio & Xamarin
Introduction to CocosSharp
Deep Dive in Xamarin.Forms
.Net Standard Libraries and Xamarin
Xamarin for iOS developers
Xamarin 4 - the future of apps
iOS & Android Dev in C# & Visual Studio using Xamarin
Introduction to Xamarin

What's hot (20)

PPTX
PDF
Native i os, android, and windows development in c# with xamarin 4
PPTX
Xamarin overview droidcon.tn
PDF
Introduction to Mobile Development with Xamarin -DotNet Westide
PDF
Customizing Xamarin.Forms UI
PDF
Native iOS and Android Development with Xamarin
PDF
Dotnetconf - Introduction to Xamarin and Xamarin.Forms
PPTX
Cross Platform Mobile Development with C# and Xamarin
PPTX
Xamarin Forms
PPTX
Xamarin Overview by Houssem Dellai
PPTX
Xamarin cross platform
PPTX
Introduction to xamarin
PPTX
Introduction to Xamarin
PPTX
Highlights from the Xamarin Evolve 2016 conference
PPTX
Getting Started with iOS & Android Development Using Xamarin & Visual Studio
PDF
Building Your First iOS App with Xamarin for Visual Studio
PDF
Mobile Cross-Platform App Development in C# with Xamarin
PPTX
Xamarin.Forms
PPTX
Xamarin Cross-Platform with Xamarin.Form, MvvmCross
KEY
Cross Platform Development with Xamarin
Native i os, android, and windows development in c# with xamarin 4
Xamarin overview droidcon.tn
Introduction to Mobile Development with Xamarin -DotNet Westide
Customizing Xamarin.Forms UI
Native iOS and Android Development with Xamarin
Dotnetconf - Introduction to Xamarin and Xamarin.Forms
Cross Platform Mobile Development with C# and Xamarin
Xamarin Forms
Xamarin Overview by Houssem Dellai
Xamarin cross platform
Introduction to xamarin
Introduction to Xamarin
Highlights from the Xamarin Evolve 2016 conference
Getting Started with iOS & Android Development Using Xamarin & Visual Studio
Building Your First iOS App with Xamarin for Visual Studio
Mobile Cross-Platform App Development in C# with Xamarin
Xamarin.Forms
Xamarin Cross-Platform with Xamarin.Form, MvvmCross
Cross Platform Development with Xamarin
Ad

Viewers also liked (13)

PPTX
Building mvvm & single pageapps in js
PPT
Programming iOS in C#
PDF
Xamarin ile Android Uygulama
PPTX
Apple Watch Intro
PPSX
Presentación paisajes sonoros c
PDF
Wearables with C# and Xamarin
PPTX
Functional GUIs with F#
PPTX
Adding Intelligence To Your Mobile Apps
PDF
用20分鐘搞懂 《系統分析、軟體工程、專案管理與設計模式》
PPTX
HDFS Namenode High Availability
PDF
Introduction to Xamarin.Forms
PDF
Recommender Systems with Ruby (adding machine learning, statistics, etc)
PPTX
Introduction to angular 2
Building mvvm & single pageapps in js
Programming iOS in C#
Xamarin ile Android Uygulama
Apple Watch Intro
Presentación paisajes sonoros c
Wearables with C# and Xamarin
Functional GUIs with F#
Adding Intelligence To Your Mobile Apps
用20分鐘搞懂 《系統分析、軟體工程、專案管理與設計模式》
HDFS Namenode High Availability
Introduction to Xamarin.Forms
Recommender Systems with Ruby (adding machine learning, statistics, etc)
Introduction to angular 2
Ad

Similar to APAC Webinar: Say Hello To Xamarin.Forms (20)

PDF
Your First Xamarin.Forms App
PPTX
Introduction to Xamarin - Confoo 2015
PDF
Introduction to Xamarin.Forms
PPTX
App innovationcircles xamarin
PDF
Windows und Windows Phone App Entwicklung (Daniel Meixner, DWX 2014)
PDF
State of Union: Xamarin & Cross-Platform .NET in 2016 and Beyond
PPTX
20141216 멜팅팟 부산 세션 ii - cross platform 개발
PDF
Tips & tricks for sharing C# code on iOS, Android and Windows Phone by Jaime ...
PPTX
Cross platform mobile app development with Xamarin
PDF
20150812 4시간만에 따라해보는 windows 10 앱 개발
PDF
Xamarin Dev Days - Introduction to Xamarin.Forms, Insights, Test Cloud
PDF
Building Mobile Cross-Platform Apps for iOS, Android & Windows in C# with Xam...
PPTX
WebAssembly and .NET
PDF
Cross Platform Mobile Development
PPTX
Cross platform mobile app development tools review
PPTX
Xamarin Platform
PDF
Introduction to Xamarin.Forms
PDF
Titanium #MDS13
PDF
Going Mobile with C#, Visual Studio, and Xamarin
PDF
(Christian heilman) firefox
Your First Xamarin.Forms App
Introduction to Xamarin - Confoo 2015
Introduction to Xamarin.Forms
App innovationcircles xamarin
Windows und Windows Phone App Entwicklung (Daniel Meixner, DWX 2014)
State of Union: Xamarin & Cross-Platform .NET in 2016 and Beyond
20141216 멜팅팟 부산 세션 ii - cross platform 개발
Tips & tricks for sharing C# code on iOS, Android and Windows Phone by Jaime ...
Cross platform mobile app development with Xamarin
20150812 4시간만에 따라해보는 windows 10 앱 개발
Xamarin Dev Days - Introduction to Xamarin.Forms, Insights, Test Cloud
Building Mobile Cross-Platform Apps for iOS, Android & Windows in C# with Xam...
WebAssembly and .NET
Cross Platform Mobile Development
Cross platform mobile app development tools review
Xamarin Platform
Introduction to Xamarin.Forms
Titanium #MDS13
Going Mobile with C#, Visual Studio, and Xamarin
(Christian heilman) firefox

More from Nish Anil (6)

PDF
[MobConf] Programming wearables in c#
PDF
[Bdotnet] Cloud connected mobile apps
PPTX
Evolve recap XHackers, Bangalore
PPTX
Building databound JavaScript apps with Knockoutjs
PPTX
Using mvvm on the web using knockoutjs & ignite ui
PDF
Infragistics: Getting Started with MVVM in WPF & Silverlight
[MobConf] Programming wearables in c#
[Bdotnet] Cloud connected mobile apps
Evolve recap XHackers, Bangalore
Building databound JavaScript apps with Knockoutjs
Using mvvm on the web using knockoutjs & ignite ui
Infragistics: Getting Started with MVVM in WPF & Silverlight

Recently uploaded (20)

PDF
DASA ADMISSION 2024_FirstRound_FirstRank_LastRank.pdf
PDF
Enhancing emotion recognition model for a student engagement use case through...
PDF
MIND Revenue Release Quarter 2 2025 Press Release
PDF
Hindi spoken digit analysis for native and non-native speakers
PDF
A comparative study of natural language inference in Swahili using monolingua...
PDF
Building Integrated photovoltaic BIPV_UPV.pdf
PDF
Agricultural_Statistics_at_a_Glance_2022_0.pdf
PPTX
1. Introduction to Computer Programming.pptx
PPTX
A Presentation on Touch Screen Technology
PDF
Transform Your ITIL® 4 & ITSM Strategy with AI in 2025.pdf
PDF
A comparative analysis of optical character recognition models for extracting...
PDF
DP Operators-handbook-extract for the Mautical Institute
PDF
Approach and Philosophy of On baking technology
PDF
ENT215_Completing-a-large-scale-migration-and-modernization-with-AWS.pdf
PDF
Encapsulation theory and applications.pdf
PPTX
cloud_computing_Infrastucture_as_cloud_p
PPTX
Group 1 Presentation -Planning and Decision Making .pptx
PDF
WOOl fibre morphology and structure.pdf for textiles
PDF
Hybrid model detection and classification of lung cancer
PPTX
OMC Textile Division Presentation 2021.pptx
DASA ADMISSION 2024_FirstRound_FirstRank_LastRank.pdf
Enhancing emotion recognition model for a student engagement use case through...
MIND Revenue Release Quarter 2 2025 Press Release
Hindi spoken digit analysis for native and non-native speakers
A comparative study of natural language inference in Swahili using monolingua...
Building Integrated photovoltaic BIPV_UPV.pdf
Agricultural_Statistics_at_a_Glance_2022_0.pdf
1. Introduction to Computer Programming.pptx
A Presentation on Touch Screen Technology
Transform Your ITIL® 4 & ITSM Strategy with AI in 2025.pdf
A comparative analysis of optical character recognition models for extracting...
DP Operators-handbook-extract for the Mautical Institute
Approach and Philosophy of On baking technology
ENT215_Completing-a-large-scale-migration-and-modernization-with-AWS.pdf
Encapsulation theory and applications.pdf
cloud_computing_Infrastucture_as_cloud_p
Group 1 Presentation -Planning and Decision Making .pptx
WOOl fibre morphology and structure.pdf for textiles
Hybrid model detection and classification of lung cancer
OMC Textile Division Presentation 2021.pptx

APAC Webinar: Say Hello To Xamarin.Forms

  • 1. Say Hello To Xamarin.Forms Nish Anil @nishanil | nish@xamarin.com
  • 2. Traditional Xamarin Development Using the Native UI SDKs ■ Build native UIs ■ UIKit & Storyboards on iOS ■ AXML for Android ■ XAML for Windows Phone ■ Write shared C# code ■ Database, Web Services ■ Business Logic ■ Share 60-80% of the code UIKit Layout XAML
  • 3. Using Xamarin.Forms Shared UI Code! To Build the User Interface ■ Use the same strategies for sharing ■ Database, Web Services ■ Business Logic ■ Build the UI with a single shared codebase ■ Share 99% of the code UIKit Layout XAML
  • 4. Using Xamarin.Forms Shared UI Code! ■ Code sharing/re-use ■ Native look and feel ■ Access to native SDKs using Custom Renderers and DependencyService ■ Camera, accelerometer, GPS, ■ NFC & more on Android ■ PassKit & more on iOS ■ Tiles & more on Windows Phone Benefits UIKit Layout XAML Shared C# User Interface Code
  • 5. Meet Xamarin.Forms Build native UIs for iOS, Android and Windows Phone from a single, shared C# codebase.
  • 6. Meet Xamarin.Forms Build native UIs for iOS, Android and Windows Phone from a single, shared C# codebase.
  • 7. Meet Xamarin.Forms Build native UIs for iOS, Android and Windows Phone from a single, shared C# codebase.
  • 8. Meet Xamarin.Forms Build native UIs for iOS, Android and Windows Phone from a single, shared C# codebase.
  • 9. Meet Xamarin.Forms Build native UIs for iOS, Android and Windows Phone from a single, shared C# codebase.
  • 10. Meet Xamarin.Forms Build native UIs for iOS, Android and Windows Phone from a single, shared C# codebase.
  • 11. Meet Xamarin.Forms public class HelloWorld : ContentPage
 {
 public HelloWorld ()
 {
 var button = new Button { Text = "Say Hello" } ;
 button.Clicked += SayHelloClicked;
 Content = new StackLayout {
 new Label { Text = "Hello World" } ,
 button
 };
 } void SayHelloClicked (object s, EventArgs e)
 {
 // do something
 }
 }
 <?xml version="1.0" encoding="UTF-8"?>
 <ContentPage xmlns="http://xamarin.com/schemas/2014/fo x:Class="HelloForms.HelloWorld">
 <StackLayout>
 <Label Text="Hello World" />
 <Button Text="Say Hello" OnClick="SayHelloClicked" />
 </StackLayout>
 </ContentPage>
 
 public partial class HelloWorld : ContentPage {
 public HelloWorld () {
 InitializeComponent ();
 }
 void SayHelloClicked (object s, EventArgs e) {
 // do something
 }
 } C# XAML
  • 12. Demo ■ File > New Project ■ Create a screen ■ Add some code ■ Run on iOS, Android, 
 & Windows Phone
  • 14. How Xamarin.Forms works Anatomy of a Xamarin.Forms Solution ■ PCL or Shared Project
  • 15. How Xamarin.Forms works Anatomy of a Xamarin.Forms Solution ■ PCL or Shared Project ■ NuGet Package
  • 16. How Xamarin.Forms works Anatomy of a Xamarin.Forms Solution ■ PCL or Shared Project ■ NuGet Package ■ App Class
  • 17. How Xamarin.Forms works Anatomy of a Xamarin.Forms Solution ■ PCL or Shared Project ■ NuGet Package ■ App Class ■ Android app
  • 18. How Xamarin.Forms works Anatomy of a Xamarin.Forms Solution ■ PCL or Shared Project ■ NuGet Package ■ App Class ■ Android app ■ iOS app
  • 19. How Xamarin.Forms works Anatomy of a Xamarin.Forms Solution ■ PCL or Shared Project ■ NuGet Package ■ App Class ■ Android app ■ iOS app ■ Windows Phone app
  • 20. Platform Renderers Taking Xamarin.Forms UI to the people (devices) ? ? ?
  • 24. Xamarin.Forms brings common UX to everyone iOS does not have a native control for the iPhone, however Xamarin.Forms uses UISplitViewController on iPad. Android has a native 'drawer' control which Xamarin.Forms uses. Windows Phone doesn’t have a comparable UI metaphor, so Xamarin.Forms provides an implementation. MasterDetailPage
  • 25. Xamarin.Forms brings common UX to everyone iOS has the UINavigationController which Xamarin.Forms leverages. Android has the navigation stack built in, but Xamarin.Forms adds the automatic 'back' button for API consistency. Windows Phone also has a back- stack with hardware button, so Xamarin.Forms takes advantage of that. NavigationPage
  • 28. Dependency Service Easily call into platform-specific code ■ In the common code ■ Code to an Interface public interface ITextToSpeech
 {
 void Speak (string text);
 }
  • 29. Dependency Service Easily call into platform-specific code ■ In the common code ■ Code to an Interface ■ Use DependencyService public interface ITextToSpeech
 {
 void Speak (string text);
 } DependencyService.Get<ITextToSpeech>().Speak("Hello from Xamarin Forms");

  • 30. Dependency Service Easily call into platform-specific code ■ In the common code ■ Code to an Interface ■ Use DependencyService ■ For each platform ■ implement the Interface [assembly: Xamarin.Forms.Dependency (typeof (Speech))] 
 public class Speech : ITextToSpeech
 {
 public Speech () { }
 public void Speak (string text)
 {
 var speechSynthesizer = new AVSpeechSynthesizer ();
 var speechUtterance = new AVSpeechUtterance (text) {
 Rate = AVSpeechUtterance.MaximumSpeechRate/4,
 Voice = AVSpeechSynthesisVoice.FromLanguage ("en-US"),
 Volume = 0.5f,
 PitchMultiplier = 1.0f
 } ;
 speechSynthesizer.SpeakUtterance (speechUtterance);
 }
 }
  • 31. Dependency Service Easily call into platform-specific code ■ In the common code ■ Code to an Interface ■ Use DependencyService ■ For each platform ■ implement the Interface ■ use Dependency attribute on the assembly [assembly: Xamarin.Forms.Dependency (typeof (Speech))] 
 public class Speech : ITextToSpeech
 {
 public Speech () { }
 public void Speak (string text)
 {
 var speechSynthesizer = new AVSpeechSynthesizer ();
 var speechUtterance = new AVSpeechUtterance (text) {
 Rate = AVSpeechUtterance.MaximumSpeechRate/4,
 Voice = AVSpeechSynthesisVoice.FromLanguage ("en-US"),
 Volume = 0.5f,
 PitchMultiplier = 1.0f
 } ;
 speechSynthesizer.SpeakUtterance (speechUtterance);
 }
 }
  • 32. Data Binding Sync views and models ■ Enables MVVM-style development ■ SetBinding in C# ■ {Binding} in XAML ■ also supports the Command pattern
  • 33. Custom Renderers Extend or Create Xamarin.Forms Controls ■ Subclass the built-in Platform Renderers ■ Build your own Xamarin.Forms
 control and renderers
 (eg. OxyPlot)
  • 34. Further Reading… ■ developer.xamarin.com ■ forums.xamarin.com ■ Creating Mobile Apps with Xamarin.Forms - Charles Petzold
 Available as a FREE download
  • 35. Thanks! Nish Anil @nishanil | nish@xamarin.com