Xamarin.Forms 
#dotbari 
write once, run everywhere and 
BE NATIVE!
What is Xamarin? 
• Un framework cross-platform per lo sviluppo 
di applicazioni mobile in C# 
• Un ambiente di sviluppo 
– Xamarin Studio 
– Xamarin plug-in per Visual Studio 
• Un ambiente di test con Xamarin Test Cloud
Xamarin Approach 
Native 
UI 
C# 
Native 
UI 
C# 
Share 
d UI 
Code 
Shared C# App Logic Shared C# App Logic 
Shared App 
Logic 
Shared App 
Logic 
Androi 
d 
UI 
Code 
Windo 
ws 
UI 
Code 
in C# 
Shared App 
Logic 
Shared App 
Logic 
iO 
S 
UI 
Andr 
oid 
UI 
Wind 
ows 
UI Shared UI 
Code 
iOS UI 
Android 
UI 
Window 
s UI 
Shared App Logic 
View and ViewModel 
(UI and controller) 
Shared App 
Logic 
Native 
UI 
C# 
Native 
UI 
C# 
Native 
UI 
C# 
Share 
d UI 
Code 
Shared C# App Logic Shared C# App Logic 
Shared App 
Logic 
Androi 
d 
UI 
Code 
Windo 
ws 
UI 
Code 
in C# 
Shared App 
Logic 
Shared App 
Logic 
iO 
S 
UI 
Andr 
oid 
UI 
Wind 
ows 
UI Shared UI 
Code 
Model 
Traditional 
(80% code reuse) 
MVVM con Xamarin.Forms 
(99,9% code reuse)
Model-View-ViewModel 
Data 
View ViewModel Model 
How to display 
information 
What to display 
Flow of interaction 
Business Logic 
Data objects 
Events 
Data
Model-View-ViewModel 
Data 
View ViewModel Model 
Events 
Xamarin.Forms 
Data Binding
What is Xamarin.Forms? 
• UI condivisa 
– 40+ Pages, Layouts, Controls 
• Dichiarativa con XAML (standard 2009) 
– Two-way Data binding 
– Commands 
– Converters
What is Xamarin.Forms? 
• Navigation 
• Animation API 
• Dependency Service 
• Messaging Center 
• Custom Controls 
• Gesture Recognizers 
• Xamarin.Forms.Maps
iOS 
Android 
WP 
Xamarin.Forms 
• La UI è composta da controlli “platform-indipendent” 
• I controlli vengono “tradotti” nei controlli 
specifici 
Label 
UILabel 
TextView 
TextBlock 
LabelRenderer 
LabelRenderer 
LabelRenderer
DEMO
Riferimenti 
• Xamarin 
– http://www.xamarin.com 
– http://blog.xamarin.com 
– http://forums.xamarin.com 
• Il mio blog 
– http://www.fabiocozzolino.eu 
– @fabiocozzolino

Xamarin Forms

  • 1.
    Xamarin.Forms #dotbari writeonce, run everywhere and BE NATIVE!
  • 2.
    What is Xamarin? • Un framework cross-platform per lo sviluppo di applicazioni mobile in C# • Un ambiente di sviluppo – Xamarin Studio – Xamarin plug-in per Visual Studio • Un ambiente di test con Xamarin Test Cloud
  • 3.
    Xamarin Approach Native UI C# Native UI C# Share d UI Code Shared C# App Logic Shared C# App Logic Shared App Logic Shared App Logic Androi d UI Code Windo ws UI Code in C# Shared App Logic Shared App Logic iO S UI Andr oid UI Wind ows UI Shared UI Code iOS UI Android UI Window s UI Shared App Logic View and ViewModel (UI and controller) Shared App Logic Native UI C# Native UI C# Native UI C# Share d UI Code Shared C# App Logic Shared C# App Logic Shared App Logic Androi d UI Code Windo ws UI Code in C# Shared App Logic Shared App Logic iO S UI Andr oid UI Wind ows UI Shared UI Code Model Traditional (80% code reuse) MVVM con Xamarin.Forms (99,9% code reuse)
  • 4.
    Model-View-ViewModel Data ViewViewModel Model How to display information What to display Flow of interaction Business Logic Data objects Events Data
  • 5.
    Model-View-ViewModel Data ViewViewModel Model Events Xamarin.Forms Data Binding
  • 6.
    What is Xamarin.Forms? • UI condivisa – 40+ Pages, Layouts, Controls • Dichiarativa con XAML (standard 2009) – Two-way Data binding – Commands – Converters
  • 7.
    What is Xamarin.Forms? • Navigation • Animation API • Dependency Service • Messaging Center • Custom Controls • Gesture Recognizers • Xamarin.Forms.Maps
  • 8.
    iOS Android WP Xamarin.Forms • La UI è composta da controlli “platform-indipendent” • I controlli vengono “tradotti” nei controlli specifici Label UILabel TextView TextBlock LabelRenderer LabelRenderer LabelRenderer
  • 9.
  • 10.
    Riferimenti • Xamarin – http://www.xamarin.com – http://blog.xamarin.com – http://forums.xamarin.com • Il mio blog – http://www.fabiocozzolino.eu – @fabiocozzolino

Editor's Notes

  • #5 -Architectural pattern -testable -View -Perfect world = just what you see -ViewModel -What to display -What is going on behind the scenes -Data and events flow back and forth to and from view -Data binding -Commands -Model -Data objects -Business logic -SQLite database
  • #6 -Updating view / viewmodel based on changes -Xamarin.Forms adds support for this -seamless communication between the two