SlideShare a Scribd company logo
Native
cross-platform
mobile apps with
C# and
Xamarin.Forms
Peter Major
Apr 25, 2015
Agenda
- Xamarin
- Xamarin Forms
- Should I use Xamarin Forms?
Building Apps Today
Objective-C / Swift - Xcode
Java - Eclipse / Android Studio
.NET - Visual Studio
Native
Hybrid
Code:
HTML + Javascript
Framework:
Ionic + Angular
Container:
Cordova, PhoneGap
What is Xamarin?
C# shared code
Compiled-to-native code
Native UI
What is Xamarin NOT?
Write once, run anywhere UI
Replacement for learning about each platform
Xamarin - iOS
AOT compiled
to ARM assembly
Mono framework included
Exposes CocoaTouch SDK
Xamarin - Android
Compiled to IL
Runs in MonoVM
Exposes Android SDK
Xamarin - Windows Phone
Compiled to IL
Uses built in phone runtime
No Mono / Xamarin SDK required
- Can I use my favorite SDK?
Yes
- Can I use my favorite Nuget package?
Sometimes
FAQ
- Are apps slower than native?
About the same *
- Are apps bigger than native?
Yes
FAQ
* https://medium.com/@harrycheung/mobile-app-performance-redux-e512be94f976
- Can I use async / await?
Yes
- Can I use “xyz” feature of .NET?
Yes *
FAQ
Architecture
from xamarin.com
Xamarin
from hanselman.com
Xamarin + Forms
from xamarin.com
- WPF? Forms will be familiar.
- Develop by feature, not by platform
Xamarin Forms
Forms?
<?xml version="1.0" encoding="UTF-8"?>
<ContentPage x:Class="EntryTest.Login">
<ContentPage.Content>
<StackLayout WidthRequest="200"
HorizontalOptions="Center"
VerticalOptions="Center">
<Entry Placeholder="Username" />
<Entry Placeholder="Password" />
<Button Text="Login"/>
</StackLayout>
</ContentPage.Content>
</ContentPage>
XAML or code
<?xml version="1.0" encoding="UTF-8"?>
<ContentPage x:Class="EntryTest.Login">
<ContentPage.Content>
<StackLayout WidthRequest="200"
HorizontalOptions="Center"
VerticalOptions="Center">
<Entry Placeholder="Username" />
<Entry Placeholder="Password" />
<Button Text="Login"/>
</StackLayout>
</ContentPage.Content>
</ContentPage>
var page = new ContentPage
{
Content = new StackLayout
{
WidthRequest = 200,
HorizontalOptions = LayoutOptions.Center,
VerticalOptions = LayoutOptions.Center,
Children =
{
new Entry { Placeholder = "Username" },
new Entry { Placeholder = "Password" },
new Button { Text = "Login" }
}
}
};
How it works
Forms controls
are converted by renderers
to native controls
Same vs Different
- promote brand
- familiar platform
Familiar platform
Customization - Style
<Style x:Key="ButtonStyle" TargetType="Button">
<Setter Property="TextColor" Value="Black" />
<Setter Property="BorderWidth" Value="1" />
<Setter Property="BorderRadius" Value="3" />
<Setter Property="BackgroundColor" Value="{StaticResource ButtonBackgroundColor}" />
<Setter Property="BorderColor" Value="{StaticResource ButtonBorderColor}" />
<Setter Property="Font" Value="{StaticResource ButtonFont}" />
<Style.Triggers>
<Trigger Property="controls:ButtonExtensions.IsPrimary" Value="True" TargetType="Button">
<Setter Property="BackgroundColor" Value="{StaticResource PrimaryBackgroundColor}" />
<Setter Property="BorderColor" Value="{StaticResource PrimaryBorderColor}" />
</Trigger>
</Style.Triggers>
</Style>
Customization - Renderer
public class StandardEntryRenderer : EntryRenderer
{
protected override void OnElementChanged (ElementChangedEventArgs<Entry> e)
{
base.OnElementChanged (e);
if (e.OldElement == null) {
AddBorderToControl ();
Control.Started += (sender, args) => Control.Layer.BorderColor = YellowBorderColor.CGColor;
Control.Ended += (sender, args) => Control.Layer.BorderColor = GreyBorderColor.CGColor;
}
}
void AddBorderToControl()
{
Control.Layer.CornerRadius = 3;
Control.Layer.BorderWidth = 1;
Control.Layer.BorderColor = GreyBorderColor.CGColor;
}
}
Customization - Renderer
public class PullToRefreshViewRenderer : VisualElementRenderer<PullToRefreshView>
{
UIRefreshControl refreshControl;
protected override void OnElementChanged(ElementChangedEventArgs<PullToRefreshView> e)
{
base.OnElementChanged (e);
var renderer = Subviews [0] as ListViewRenderer;
if (renderer == null)
return;
refreshControl = new UIRefreshControl ();
refreshControl.ValueChanged += OnRefreshingChanged;
renderer.Control.AddSubview(refreshControl);
UpdateIsRefreshing();
}
}
Customization - per-platform
<OnPlatform x:TypeArguments="Font"
Android="sans-serif,None,21"
iOS="HelveticaNeue,None,16"
x:Key="TitleFont"/>
<Style x:Key="TitleLabel" TargetType="Label">
<Setter Property="AbsoluteLayout.LayoutBounds" Value="0,0,AutoSize,AutoSize" />
<Setter Property="AbsoluteLayout.LayoutFlags" Value="PositionProportional" />
<Setter Property="Font" Value="{StaticResource TitleFont}" />
<Setter Property="TextColor" Value="#333" />
</Style>
MVVM
<StackLayout>
<Entry Text="{Binding Username}"/>
<Entry Text="{Binding Password}"/>
<Button Text="Login"
Command="{Binding LoginCommand}"/>
</StackLayout>
public class LoginViewModel : INotifyPropertyChanged
{
public event PropertyChangedEventHandler PropertyChanged;
public Command LoginCommand { get; private set; }
string _username;
public string Username
{
get { return _username; }
set {
_username = value;
NotifyPropertyChanged(); }
}
// continued…
}
Attached Properties / Triggers
<Style x:Key="ButtonStyle" TargetType="Button">
<Setter Property="TextColor" Value="Black" />
<Setter Property="BorderWidth" Value="1" />
<Setter Property="BorderRadius" Value="3" />
<Setter Property="BackgroundColor" Value="{StaticResource ButtonBackgroundColor}" />
<Setter Property="BorderColor" Value="{StaticResource ButtonBorderColor}" />
<Setter Property="Font" Value="{StaticResource ButtonFont}" />
<Style.Triggers>
<Trigger Property="controls:ButtonExtensions.IsPrimary" Value="True" TargetType="Button">
<Setter Property="BackgroundColor" Value="{StaticResource PrimaryBackgroundColor}" />
<Setter Property="BorderColor" Value="{StaticResource PrimaryBorderColor}" />
</Trigger>
</Style.Triggers>
</Style>
Behaviors
<Entry Placeholder="Enter a System.Double">
<Entry.Behaviors>
<local:NumericValidationBehavior />
</Entry.Behaviors>
</Entry>
public class NumericValidationBehavior : Behavior<Entry>
{
protected override void OnAttachedTo(Entry entry)
{
entry.TextChanged += OnEntryTextChanged;
base.OnAttachedTo(entry);
}
protected override void OnDetachingFrom(Entry entry)
{
entry.TextChanged -= OnEntryTextChanged;
base.OnDetachingFrom(entry);
}
void OnEntryTextChanged(object sender, TextChangedEventArgs args)
{
double result;
bool isValid = Double.TryParse (args.NewTextValue, out result);
((Entry)sender).TextColor = isValid ? Color.Default : Color.Red;
}
}
- DependencyService
- MessagingCenter
- Navigation
Other features
- Are XF apps slower than native?
Yes
- Are XF apps bigger than native?
Yes
Speed / size redux
- New or Existing product?
- New or Existing team?
- Resources vs user experience
Should I use XF?
- Mockups
- Prototypes
And even if you don’t...
- One UI layout
- Very customizable
- Initial customization investment
- Develop by feature
- Very active development
Good
- Bugs, fix with renderers
- Renderers have “internal” code
- No XAML designer
- Open source?
Bad
- Getting started:
http://developer.xamarin.com/guides/cross-platform/getting_started/
- Licensing:
https://store.xamarin.com/
- Samples:
https://github.com/xamarin/monotouch-samples / https://github.com/xamarin/monodroid-
samples
- Forms documentation:
http://developer.xamarin.com/guides/cross-platform/xamarin-forms/
- Forms samples:
https://github.com/xamarin/xamarin-forms-samples
Resources

More Related Content

Viewers also liked (14)

PDF
Developing and Designing Native Mobile Apps in Visual Studio
Xamarin
 
PPTX
Introduction to xamarin
Christos Matskas
 
PPTX
Crear Apps móviles multiplataforma con Xamarin compartiendo la mayor cantidad...
Javier Suárez Ruiz
 
PPTX
Xamarin.Forms
marcofolio
 
PPTX
Conociendo el resto de ecosistema Xamarin
Javier Suárez Ruiz
 
PPTX
Novedades en Visual Studio Online
Javier Suárez Ruiz
 
PPTX
Crear Apps Multiplataforma compartiendo la mayor cantidad con Xamarin
Javier Suárez Ruiz
 
PDF
[XamarinDay] Développez en XAML avec Xamarin Forms
Cellenza
 
PPTX
Introduction to Xamarin 2.0
Xamarin
 
PPTX
Xamarin Mobile Leaders Summit: The Mobile Mind Shift: Opportunities, Challeng...
Xamarin
 
PPTX
Introducción a Xamarin
Javier Suárez Ruiz
 
PDF
Xamarin Mobile Leaders Summit | Solving the Unique Challenges in Mobile DevOps
Xamarin
 
PPTX
Introducción al desarrollo de Apps en Windows 10
Javier Suárez Ruiz
 
PPTX
Introduction à Xamarin
Patrice Cote
 
Developing and Designing Native Mobile Apps in Visual Studio
Xamarin
 
Introduction to xamarin
Christos Matskas
 
Crear Apps móviles multiplataforma con Xamarin compartiendo la mayor cantidad...
Javier Suárez Ruiz
 
Xamarin.Forms
marcofolio
 
Conociendo el resto de ecosistema Xamarin
Javier Suárez Ruiz
 
Novedades en Visual Studio Online
Javier Suárez Ruiz
 
Crear Apps Multiplataforma compartiendo la mayor cantidad con Xamarin
Javier Suárez Ruiz
 
[XamarinDay] Développez en XAML avec Xamarin Forms
Cellenza
 
Introduction to Xamarin 2.0
Xamarin
 
Xamarin Mobile Leaders Summit: The Mobile Mind Shift: Opportunities, Challeng...
Xamarin
 
Introducción a Xamarin
Javier Suárez Ruiz
 
Xamarin Mobile Leaders Summit | Solving the Unique Challenges in Mobile DevOps
Xamarin
 
Introducción al desarrollo de Apps en Windows 10
Javier Suárez Ruiz
 
Introduction à Xamarin
Patrice Cote
 

Similar to Native cross-platform mobile apps with C# and Xamarin.Forms (20)

PDF
Introduction to Xamarin.Forms
Brad Pillow
 
PPTX
App innovationcircles xamarin
Mohit Chhabra
 
PPTX
extending-and-optimizing-xamarin-forms-apps
Matthew Soucoup
 
PPTX
Xamarin overview droidcon.tn
Houssem Dellai
 
PDF
Diving Into Xamarin.Forms
Catapult New Business
 
PPTX
Cross platform mobile app development with Xamarin
Pranav Ainavolu
 
PPTX
Xamarin Forms
Rui Marinho
 
PDF
Xamarin.Forms
Nicolò Carandini
 
PPTX
Cross-Plattform Native User Interfaces with Xamarin.Forms
Andreas Kuntner
 
PPTX
Introduction to Cross Platform Mobile Apps (Xamarin)
BizTalk360
 
PDF
Optimizing and Extending Xamarin.Forms iOS, Android, and UWP Apps
James Montemagno
 
PPTX
Xamarin Dev Days - Xamarin.Forms
Pranav Ainavolu
 
PDF
10 Awesome Xamarin.Forms Tips & Tricks
Michael Ridland
 
PPTX
Xamarin.Forms a different approach to cross platform natove mobile development
Dan Ardelean
 
PPTX
Introduction to Xamarin.Forms and Lessons Learnt
Michael Ridland
 
PDF
Intro to Xamarin
Abhishek-Joshi
 
PPTX
Xamarin.Forms: a cross-platform mobile UI toolkit - ConFoo 2016
Guy Barrette
 
PPTX
Introduction to Xamarin.Forms 2.x
Craig Dunn
 
PPTX
Introduction to Xamarin
Vinicius Quaiato
 
PPTX
Cross platform app dev with xamarin forms
Shahriar Hossain
 
Introduction to Xamarin.Forms
Brad Pillow
 
App innovationcircles xamarin
Mohit Chhabra
 
extending-and-optimizing-xamarin-forms-apps
Matthew Soucoup
 
Xamarin overview droidcon.tn
Houssem Dellai
 
Diving Into Xamarin.Forms
Catapult New Business
 
Cross platform mobile app development with Xamarin
Pranav Ainavolu
 
Xamarin Forms
Rui Marinho
 
Xamarin.Forms
Nicolò Carandini
 
Cross-Plattform Native User Interfaces with Xamarin.Forms
Andreas Kuntner
 
Introduction to Cross Platform Mobile Apps (Xamarin)
BizTalk360
 
Optimizing and Extending Xamarin.Forms iOS, Android, and UWP Apps
James Montemagno
 
Xamarin Dev Days - Xamarin.Forms
Pranav Ainavolu
 
10 Awesome Xamarin.Forms Tips & Tricks
Michael Ridland
 
Xamarin.Forms a different approach to cross platform natove mobile development
Dan Ardelean
 
Introduction to Xamarin.Forms and Lessons Learnt
Michael Ridland
 
Intro to Xamarin
Abhishek-Joshi
 
Xamarin.Forms: a cross-platform mobile UI toolkit - ConFoo 2016
Guy Barrette
 
Introduction to Xamarin.Forms 2.x
Craig Dunn
 
Introduction to Xamarin
Vinicius Quaiato
 
Cross platform app dev with xamarin forms
Shahriar Hossain
 
Ad

Recently uploaded (20)

PDF
"Beyond English: Navigating the Challenges of Building a Ukrainian-language R...
Fwdays
 
PPTX
AUTOMATION AND ROBOTICS IN PHARMA INDUSTRY.pptx
sameeraaabegumm
 
PPTX
WooCommerce Workshop: Bring Your Laptop
Laura Hartwig
 
PPTX
MSP360 Backup Scheduling and Retention Best Practices.pptx
MSP360
 
PDF
HubSpot Main Hub: A Unified Growth Platform
Jaswinder Singh
 
PDF
Fl Studio 24.2.2 Build 4597 Crack for Windows Free Download 2025
faizk77g
 
PDF
New from BookNet Canada for 2025: BNC BiblioShare - Tech Forum 2025
BookNet Canada
 
PDF
Newgen 2022-Forrester Newgen TEI_13 05 2022-The-Total-Economic-Impact-Newgen-...
darshakparmar
 
PDF
HCIP-Data Center Facility Deployment V2.0 Training Material (Without Remarks ...
mcastillo49
 
PDF
[Newgen] NewgenONE Marvin Brochure 1.pdf
darshakparmar
 
PDF
CIFDAQ Market Insights for July 7th 2025
CIFDAQ
 
PDF
Python basic programing language for automation
DanialHabibi2
 
PDF
Log-Based Anomaly Detection: Enhancing System Reliability with Machine Learning
Mohammed BEKKOUCHE
 
PDF
DevBcn - Building 10x Organizations Using Modern Productivity Metrics
Justin Reock
 
PDF
Bitcoin for Millennials podcast with Bram, Power Laws of Bitcoin
Stephen Perrenod
 
PDF
Reverse Engineering of Security Products: Developing an Advanced Microsoft De...
nwbxhhcyjv
 
PDF
Timothy Rottach - Ramp up on AI Use Cases, from Vector Search to AI Agents wi...
AWS Chicago
 
PDF
Smart Trailers 2025 Update with History and Overview
Paul Menig
 
PPTX
"Autonomy of LLM Agents: Current State and Future Prospects", Oles` Petriv
Fwdays
 
PDF
Jak MŚP w Europie Środkowo-Wschodniej odnajdują się w świecie AI
dominikamizerska1
 
"Beyond English: Navigating the Challenges of Building a Ukrainian-language R...
Fwdays
 
AUTOMATION AND ROBOTICS IN PHARMA INDUSTRY.pptx
sameeraaabegumm
 
WooCommerce Workshop: Bring Your Laptop
Laura Hartwig
 
MSP360 Backup Scheduling and Retention Best Practices.pptx
MSP360
 
HubSpot Main Hub: A Unified Growth Platform
Jaswinder Singh
 
Fl Studio 24.2.2 Build 4597 Crack for Windows Free Download 2025
faizk77g
 
New from BookNet Canada for 2025: BNC BiblioShare - Tech Forum 2025
BookNet Canada
 
Newgen 2022-Forrester Newgen TEI_13 05 2022-The-Total-Economic-Impact-Newgen-...
darshakparmar
 
HCIP-Data Center Facility Deployment V2.0 Training Material (Without Remarks ...
mcastillo49
 
[Newgen] NewgenONE Marvin Brochure 1.pdf
darshakparmar
 
CIFDAQ Market Insights for July 7th 2025
CIFDAQ
 
Python basic programing language for automation
DanialHabibi2
 
Log-Based Anomaly Detection: Enhancing System Reliability with Machine Learning
Mohammed BEKKOUCHE
 
DevBcn - Building 10x Organizations Using Modern Productivity Metrics
Justin Reock
 
Bitcoin for Millennials podcast with Bram, Power Laws of Bitcoin
Stephen Perrenod
 
Reverse Engineering of Security Products: Developing an Advanced Microsoft De...
nwbxhhcyjv
 
Timothy Rottach - Ramp up on AI Use Cases, from Vector Search to AI Agents wi...
AWS Chicago
 
Smart Trailers 2025 Update with History and Overview
Paul Menig
 
"Autonomy of LLM Agents: Current State and Future Prospects", Oles` Petriv
Fwdays
 
Jak MŚP w Europie Środkowo-Wschodniej odnajdują się w świecie AI
dominikamizerska1
 
Ad

Native cross-platform mobile apps with C# and Xamarin.Forms

  • 1. Native cross-platform mobile apps with C# and Xamarin.Forms Peter Major Apr 25, 2015
  • 2. Agenda - Xamarin - Xamarin Forms - Should I use Xamarin Forms?
  • 4. Objective-C / Swift - Xcode Java - Eclipse / Android Studio .NET - Visual Studio Native
  • 5. Hybrid Code: HTML + Javascript Framework: Ionic + Angular Container: Cordova, PhoneGap
  • 6. What is Xamarin? C# shared code Compiled-to-native code Native UI
  • 7. What is Xamarin NOT? Write once, run anywhere UI Replacement for learning about each platform
  • 8. Xamarin - iOS AOT compiled to ARM assembly Mono framework included Exposes CocoaTouch SDK
  • 9. Xamarin - Android Compiled to IL Runs in MonoVM Exposes Android SDK
  • 10. Xamarin - Windows Phone Compiled to IL Uses built in phone runtime No Mono / Xamarin SDK required
  • 11. - Can I use my favorite SDK? Yes - Can I use my favorite Nuget package? Sometimes FAQ
  • 12. - Are apps slower than native? About the same * - Are apps bigger than native? Yes FAQ * https://medium.com/@harrycheung/mobile-app-performance-redux-e512be94f976
  • 13. - Can I use async / await? Yes - Can I use “xyz” feature of .NET? Yes * FAQ
  • 16. Xamarin + Forms from xamarin.com
  • 17. - WPF? Forms will be familiar. - Develop by feature, not by platform Xamarin Forms
  • 18. Forms? <?xml version="1.0" encoding="UTF-8"?> <ContentPage x:Class="EntryTest.Login"> <ContentPage.Content> <StackLayout WidthRequest="200" HorizontalOptions="Center" VerticalOptions="Center"> <Entry Placeholder="Username" /> <Entry Placeholder="Password" /> <Button Text="Login"/> </StackLayout> </ContentPage.Content> </ContentPage>
  • 19. XAML or code <?xml version="1.0" encoding="UTF-8"?> <ContentPage x:Class="EntryTest.Login"> <ContentPage.Content> <StackLayout WidthRequest="200" HorizontalOptions="Center" VerticalOptions="Center"> <Entry Placeholder="Username" /> <Entry Placeholder="Password" /> <Button Text="Login"/> </StackLayout> </ContentPage.Content> </ContentPage> var page = new ContentPage { Content = new StackLayout { WidthRequest = 200, HorizontalOptions = LayoutOptions.Center, VerticalOptions = LayoutOptions.Center, Children = { new Entry { Placeholder = "Username" }, new Entry { Placeholder = "Password" }, new Button { Text = "Login" } } } };
  • 20. How it works Forms controls are converted by renderers to native controls
  • 21. Same vs Different - promote brand - familiar platform
  • 23. Customization - Style <Style x:Key="ButtonStyle" TargetType="Button"> <Setter Property="TextColor" Value="Black" /> <Setter Property="BorderWidth" Value="1" /> <Setter Property="BorderRadius" Value="3" /> <Setter Property="BackgroundColor" Value="{StaticResource ButtonBackgroundColor}" /> <Setter Property="BorderColor" Value="{StaticResource ButtonBorderColor}" /> <Setter Property="Font" Value="{StaticResource ButtonFont}" /> <Style.Triggers> <Trigger Property="controls:ButtonExtensions.IsPrimary" Value="True" TargetType="Button"> <Setter Property="BackgroundColor" Value="{StaticResource PrimaryBackgroundColor}" /> <Setter Property="BorderColor" Value="{StaticResource PrimaryBorderColor}" /> </Trigger> </Style.Triggers> </Style>
  • 24. Customization - Renderer public class StandardEntryRenderer : EntryRenderer { protected override void OnElementChanged (ElementChangedEventArgs<Entry> e) { base.OnElementChanged (e); if (e.OldElement == null) { AddBorderToControl (); Control.Started += (sender, args) => Control.Layer.BorderColor = YellowBorderColor.CGColor; Control.Ended += (sender, args) => Control.Layer.BorderColor = GreyBorderColor.CGColor; } } void AddBorderToControl() { Control.Layer.CornerRadius = 3; Control.Layer.BorderWidth = 1; Control.Layer.BorderColor = GreyBorderColor.CGColor; } }
  • 25. Customization - Renderer public class PullToRefreshViewRenderer : VisualElementRenderer<PullToRefreshView> { UIRefreshControl refreshControl; protected override void OnElementChanged(ElementChangedEventArgs<PullToRefreshView> e) { base.OnElementChanged (e); var renderer = Subviews [0] as ListViewRenderer; if (renderer == null) return; refreshControl = new UIRefreshControl (); refreshControl.ValueChanged += OnRefreshingChanged; renderer.Control.AddSubview(refreshControl); UpdateIsRefreshing(); } }
  • 26. Customization - per-platform <OnPlatform x:TypeArguments="Font" Android="sans-serif,None,21" iOS="HelveticaNeue,None,16" x:Key="TitleFont"/> <Style x:Key="TitleLabel" TargetType="Label"> <Setter Property="AbsoluteLayout.LayoutBounds" Value="0,0,AutoSize,AutoSize" /> <Setter Property="AbsoluteLayout.LayoutFlags" Value="PositionProportional" /> <Setter Property="Font" Value="{StaticResource TitleFont}" /> <Setter Property="TextColor" Value="#333" /> </Style>
  • 27. MVVM <StackLayout> <Entry Text="{Binding Username}"/> <Entry Text="{Binding Password}"/> <Button Text="Login" Command="{Binding LoginCommand}"/> </StackLayout> public class LoginViewModel : INotifyPropertyChanged { public event PropertyChangedEventHandler PropertyChanged; public Command LoginCommand { get; private set; } string _username; public string Username { get { return _username; } set { _username = value; NotifyPropertyChanged(); } } // continued… }
  • 28. Attached Properties / Triggers <Style x:Key="ButtonStyle" TargetType="Button"> <Setter Property="TextColor" Value="Black" /> <Setter Property="BorderWidth" Value="1" /> <Setter Property="BorderRadius" Value="3" /> <Setter Property="BackgroundColor" Value="{StaticResource ButtonBackgroundColor}" /> <Setter Property="BorderColor" Value="{StaticResource ButtonBorderColor}" /> <Setter Property="Font" Value="{StaticResource ButtonFont}" /> <Style.Triggers> <Trigger Property="controls:ButtonExtensions.IsPrimary" Value="True" TargetType="Button"> <Setter Property="BackgroundColor" Value="{StaticResource PrimaryBackgroundColor}" /> <Setter Property="BorderColor" Value="{StaticResource PrimaryBorderColor}" /> </Trigger> </Style.Triggers> </Style>
  • 29. Behaviors <Entry Placeholder="Enter a System.Double"> <Entry.Behaviors> <local:NumericValidationBehavior /> </Entry.Behaviors> </Entry> public class NumericValidationBehavior : Behavior<Entry> { protected override void OnAttachedTo(Entry entry) { entry.TextChanged += OnEntryTextChanged; base.OnAttachedTo(entry); } protected override void OnDetachingFrom(Entry entry) { entry.TextChanged -= OnEntryTextChanged; base.OnDetachingFrom(entry); } void OnEntryTextChanged(object sender, TextChangedEventArgs args) { double result; bool isValid = Double.TryParse (args.NewTextValue, out result); ((Entry)sender).TextColor = isValid ? Color.Default : Color.Red; } }
  • 30. - DependencyService - MessagingCenter - Navigation Other features
  • 31. - Are XF apps slower than native? Yes - Are XF apps bigger than native? Yes Speed / size redux
  • 32. - New or Existing product? - New or Existing team? - Resources vs user experience Should I use XF?
  • 33. - Mockups - Prototypes And even if you don’t...
  • 34. - One UI layout - Very customizable - Initial customization investment - Develop by feature - Very active development Good
  • 35. - Bugs, fix with renderers - Renderers have “internal” code - No XAML designer - Open source? Bad
  • 36. - Getting started: http://developer.xamarin.com/guides/cross-platform/getting_started/ - Licensing: https://store.xamarin.com/ - Samples: https://github.com/xamarin/monotouch-samples / https://github.com/xamarin/monodroid- samples - Forms documentation: http://developer.xamarin.com/guides/cross-platform/xamarin-forms/ - Forms samples: https://github.com/xamarin/xamarin-forms-samples Resources

Editor's Notes

  • #2: Background: .NET / WPF / AngularJS Xamarin: 8 months ago Forms: 6 months ago Ordertracker: Customer - where is my order / Restaurant - where are my drivers
  • #3: iOS exposes CocoaTouch SDK (ex. UIKit) Android exposes Android SDK interacts with native types via JNI most of Mono.Android is just wrappers
  • #4: Native / Siloed
  • #6: Language / UI / Container Abandoned: Facebook / LinkedIn Problems: debugging, performance, animation Combination: Instagram - timeline, JUST EAT - checkout Cordova provides an abstraction over OS services like location
  • #7: Makes cross-platform applications easier
  • #9: No JIT
  • #10: interacts with native types via JNI most of Mono.Android is just wrappers
  • #12: SDK: Google Analytics / AWS-SDK iOS: binaries (.a) / headers (.h) + bindings Android: .jar + bindings Nuget: Autofac / JSON.Net PCL or Android/iOS specific C# code
  • #13: iOS: C++ / Swift faster , Objective-C slower Android: C++ faster , Davlik same Frameworks iOS - generics special case Xamarin Forms, a bit more so too.
  • #14: Dynamic Runtime Language - NO Generics - Of Course!
  • #15: iOS: storyboard, xib Android: layouts, drawables, styles WP: xaml
  • #16: iOS: storyboard, xib Android: layouts, drawables, styles WP: xaml
  • #17: iOS: storyboard, xib Android: layouts, drawables, styles WP: xaml
  • #28: Variation of patterns like MVC / MVP VM is a dataconverter between the view and model Goal is to remove all “code-behind” from .NET (WPF) Forms
  • #30: Variation of patterns like MVC / MVP VM is a dataconverter between the view and model Goal is to remove all “code-behind” from .NET (WPF) Forms
  • #31: DS: Service Locator pattern Static singleton (again) No constructor injection MC: Used internally by XF Static singleton Strange generic syntax
  • #33: For new team: start simple gain platform experience mix experienced with non-experienced code sharing vs custom UI