Building Multi-Platform Native
Apps with MVVM and C#
Greg Shackles
Senior Software Engineer
Olo
@gshackles
[email protected]
github.com/gshackles
Slide 2
Slide 2 text
gonemobile.io @GoneMobileCast
Slide 3
Slide 3 text
Google Apple RIM Microsoft Symbian
52.5% Android
41.4% Apple
3.3% Microsoft
2.5% RIM
Source: comScore
US Market Share: April 2014
Slide 4
Slide 4 text
Write Once, Run Anywhere
Slide 5
Slide 5 text
Write Once, Run Anywhere
BUSTED
Slide 6
Slide 6 text
Xamarin: C# All The Things! *
* and F# too!
Slide 7
Slide 7 text
Xamarin: C# All The Things! *
* and F# too!
•100% Native
Slide 8
Slide 8 text
Xamarin: C# All The Things! *
* and F# too!
•100% Native
•Full access to platform SDKs
Slide 9
Slide 9 text
Xamarin: C# All The Things! *
* and F# too!
•100% Native
•Full access to platform SDKs
•BCL, Async, LINQ, etc
Slide 10
Slide 10 text
Xamarin: C# All The Things! *
* and F# too!
•100% Native
•Full access to platform SDKs
•BCL, Async, LINQ, etc
•Improved API
Slide 11
Slide 11 text
Xamarin: C# All The Things! *
* and F# too!
•100% Native
•Full access to platform SDKs
•BCL, Async, LINQ, etc
•Improved API
•Shared code across platforms
Slide 12
Slide 12 text
Xamarin: C# All The Things! *
* and F# too!
•100% Native
•Full access to platform SDKs
•BCL, Async, LINQ, etc
•Improved API
•Shared code across platforms
•Garbage collection
Slide 13
Slide 13 text
Xamarin: C# All The Things! *
* and F# too!
•100% Native
•Full access to platform SDKs
•BCL, Async, LINQ, etc
•Improved API
•Shared code across platforms
•Garbage collection
•Visual Studio / Xamarin Studio
Slide 14
Slide 14 text
Xamarin: C# All The Things! *
* and F# too!
•100% Native
•Full access to platform SDKs
•BCL, Async, LINQ, etc
•Improved API
•Shared code across platforms
•Garbage collection
•Visual Studio / Xamarin Studio
•Frequent Releases
Slide 15
Slide 15 text
MVVM
Slide 16
Slide 16 text
MVVM
View
Slide 17
Slide 17 text
MVVM
View Model
Slide 18
Slide 18 text
MVVM
View View Model Model
Slide 19
Slide 19 text
MVVM
View Binder View Model Model
Slide 20
Slide 20 text
MVVM
Click Me
View Binder View Model Model
Slide 21
Slide 21 text
MVVM
Click Me
1. action
View Binder View Model Model
Slide 22
Slide 22 text
MVVM
Click Me
1. action
2. event handling
View Binder View Model Model
Slide 23
Slide 23 text
MVVM
Click Me
1. action
2. event handling
3. command
View Binder View Model Model
Slide 24
Slide 24 text
MVVM
Click Me
1. action
2. event handling
3. command
4. access data
View Binder View Model Model
Slide 25
Slide 25 text
MVVM
Click Me
1. action
2. event handling
3. command
4. access data
5. notify change
View Binder View Model Model
Slide 26
Slide 26 text
MVVM
Click Me
1. action
2. event handling
3. command
4. access data
5. notify change
6. get changed data
View Binder View Model Model
Slide 27
Slide 27 text
MVVM
Click Me
Hello
World!
1. action
2. event handling
3. command
4. access data
5. notify change
6. get changed data
7. update UI
View Binder View Model Model
Slide 28
Slide 28 text
MvvmCross
Slide 29
Slide 29 text
MvvmCross
Slide 30
Slide 30 text
MvvmCross: Highlights
Slide 31
Slide 31 text
• Shared behavior, not presentation
MvvmCross: Highlights
Slide 32
Slide 32 text
• Shared behavior, not presentation
• Bind all the platforms!
MvvmCross: Highlights
Slide 33
Slide 33 text
• Shared behavior, not presentation
• Bind all the platforms!
• Powerful binding options
MvvmCross: Highlights
Slide 34
Slide 34 text
• Shared behavior, not presentation
• Bind all the platforms!
• Powerful binding options
• Convention over configuration
MvvmCross: Highlights
Slide 35
Slide 35 text
• Shared behavior, not presentation
• Bind all the platforms!
• Powerful binding options
• Convention over configuration
• Pluggable architecture
MvvmCross: Highlights
Slide 36
Slide 36 text
• Shared behavior, not presentation
• Bind all the platforms!
• Powerful binding options
• Convention over configuration
• Pluggable architecture
• PCL
MvvmCross: Highlights
Slide 37
Slide 37 text
• Shared behavior, not presentation
• Bind all the platforms!
• Powerful binding options
• Convention over configuration
• Pluggable architecture
• PCL
• Inversion of Control
MvvmCross: Highlights
Slide 38
Slide 38 text
• Shared behavior, not presentation
• Bind all the platforms!
• Powerful binding options
• Convention over configuration
• Pluggable architecture
• PCL
• Inversion of Control
• Testable
MvvmCross: Highlights