Top Banner
MVVM pattern as a way of creating loosely coupled, maintainable and testable Xamarin apps Sylwester Wieczorkowski [email protected]
19

Mvvm Pattern in Xamarin - MvvmCross and Xamarin.Forms

Jan 11, 2017

Download

Software

Leaware.com
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Mvvm Pattern in Xamarin - MvvmCross and Xamarin.Forms

MVVMpatternasawayofcreatinglooselycoupled,maintainableandtestableXamarin apps

Sylwester [email protected]

Page 2: Mvvm Pattern in Xamarin - MvvmCross and Xamarin.Forms

Xamarin Platform

ü NativeUI,nativeAPIaccess,andnativeperformance

ü AnythingyoucandoinObjective-C,Swift,orJavayoucandoinC#withXamarin

ü Shipcutting-edgeappswithsame-daysupportfornewOSreleases

Page 3: Mvvm Pattern in Xamarin - MvvmCross and Xamarin.Forms

Xamarin TestCloud

ü Testsbehaveasusersdo–performingtaps,pinches,swipes,andmore

ü IntegrateswithCIforcontinuousautomatedtesting,testingappsoneverychange

ü Ensuresappslookandfeelexcellentwithfull-framescreenshotsandvideoplayback

Page 4: Mvvm Pattern in Xamarin - MvvmCross and Xamarin.Forms

Xamarin Insights+HockeyApp

ü Getmeaningfulcrashreportswiththemostreliablecrashreportingonthemarket

ü Seehowyourappisusedandwhatyourtestershavealreadycovered

ü Communicatewithyourusersandgetfeedback,supportrequests,andbugreportsfromwithinyourapp

Page 5: Mvvm Pattern in Xamarin - MvvmCross and Xamarin.Forms

SiloApproach

iOSApp

Objective-CXCode

AndroidApp

JavaAndroidStudio

WindowsApp

C#VisualStudio

Page 6: Mvvm Pattern in Xamarin - MvvmCross and Xamarin.Forms

TraditionalXamarin Approach

iOSC#UI AndroidC#UI WindowsC#UI

SharedC# Logic

Page 7: Mvvm Pattern in Xamarin - MvvmCross and Xamarin.Forms

TraditionalXamarin Approach

ü Appsthatrequirespecializedinteractions

ü Appswithhighlypolisheddesign

ü Appsthatusemanyplatform-specificAPIs

ü AppswherecustomUIismoreimportantthancodesharing

Page 8: Mvvm Pattern in Xamarin - MvvmCross and Xamarin.Forms

What’sMVVM?

View ViewModel Model

PresentationandPresentationLogic BusinessLogicandData

DataBinding

Page 9: Mvvm Pattern in Xamarin - MvvmCross and Xamarin.Forms

TraditionalXamarin Approach

v Createyourownframework

• SharedProject

• PortableClassLibrary

vUseanexistingMVVMsolution

• Bind

• MVVMLight

• ReactiveUI

• MvvmCross

ProjectStyles

Page 10: Mvvm Pattern in Xamarin - MvvmCross and Xamarin.Forms

DEMOMvvmCross

Page 11: Mvvm Pattern in Xamarin - MvvmCross and Xamarin.Forms

Belfius DirectMobile

Page 12: Mvvm Pattern in Xamarin - MvvmCross and Xamarin.Forms

Belfius DirectMobile

Page 13: Mvvm Pattern in Xamarin - MvvmCross and Xamarin.Forms

BNPParibasFortis

Page 14: Mvvm Pattern in Xamarin - MvvmCross and Xamarin.Forms

BNPParibasFortis

Page 15: Mvvm Pattern in Xamarin - MvvmCross and Xamarin.Forms

Xamarin.Forms Approach

SharedC# Logic

Xamarin.Forms - SharedC# UI

Page 16: Mvvm Pattern in Xamarin - MvvmCross and Xamarin.Forms

Xamarin.Forms Approach

ü Dataentryapps

ü Prototypesandproofs-of-concept

ü Appsthatrequirelittleplatform-specificfunctionality

ü AppswherecodesharingismoreimportantthancustomUI

Page 17: Mvvm Pattern in Xamarin - MvvmCross and Xamarin.Forms

Xamarin.Forms Approach

v Createyourownframework

• SticktoXamarin.Forms mechanisms(e.g.DependencyService,MessagingCenter)

• ImplementINotifyPropertyChangedandICommand

ProjectStyles

vUseanexistingMVVMsolution

• MugenMVVMToolkit

• MVVMLight

• FreshMvvm

• MvvmCross-Forms

• Prism

Page 18: Mvvm Pattern in Xamarin - MvvmCross and Xamarin.Forms

PrismforXamarin.Forms

ü MVVMSupport

ü Commanding

ü Messaging

ü Navigation

ü PageDialogService

ü Logging

ü DependencyInjection

Page 19: Mvvm Pattern in Xamarin - MvvmCross and Xamarin.Forms

DEMOPrism for Xamarin.Forms