Top Banner
@slodge MvvmCross Gitte Vermeiren @gittetitter proq.blogspot.com
29

Mvvm crossevent basics

May 07, 2015

Download

Technology

Qframe
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 crossevent basics

@slodge

MvvmCross

Gitte [email protected]

Page 2: Mvvm crossevent basics

@slodge

Page 3: Mvvm crossevent basics

@slodge

Can we do this?

Portable Class

LibrariesXamarin MvvmCross

Page 4: Mvvm crossevent basics

@slodge

Portable Class Libraries

Page 5: Mvvm crossevent basics

@slodge

Page 6: Mvvm crossevent basics

@slodge

Profile 104• WPF – 4.5+• Windows Store (WinRT)• Windows Phone – 7.1+• Xamarin.Android• Xamarin.iOS

Page 7: Mvvm crossevent basics

@slodge

Xamarin

Page 8: Mvvm crossevent basics

@slodge

Xamarin for Android/iOS

Business Logic

UI Logic

WP iOS Droid Win8

Data Access

Business Logic

Service Interface

Service Consumption Local Data/Services

Xamarin

Page 9: Mvvm crossevent basics

@slodge

Xamarin for Android/iOS

Code Completion for Native

APIs

Visual Studio Integration

Advanced Debugging

Support

Point and click UI design

Page 10: Mvvm crossevent basics

@slodge

Xamarin for Android/iOS

Page 11: Mvvm crossevent basics

@slodge

MvvmCross

Page 12: Mvvm crossevent basics

@slodge

View

ViewM

odel

Model

get/set Propertiescall Commands

notify changessome messaging

Whatever C# you like …

… messages work well!

ViewView

ViewM

odelView

Model

ModelM

odel

Cross PlatformPlatform Specific

Page 13: Mvvm crossevent basics

@slodge

Separation of Concerns

Designable (Blend)

More structured

code

TestableDatabinding

Code reuse

Page 14: Mvvm crossevent basics

@slodge

Data Binding

Page 15: Mvvm crossevent basics

@slodge

INotifyPropertyChanged

Page 16: Mvvm crossevent basics

@slodge

Typical ViewModel Property

Page 17: Mvvm crossevent basics

@slodge

One Way BindingPersonViewModel

FirstName

LastName

DateOfBirth

First Name

Jon

Last Name

Doe

Date of birth

12/07/1989

Page 18: Mvvm crossevent basics

@slodge

UI Syntax

Page 19: Mvvm crossevent basics

@slodge

Two Way BindingPersonViewModel

FirstName

LastName

DateOfBirth

First Name

Jon

Last Name

Doe

Date of birth

12/07/1989

Page 20: Mvvm crossevent basics

@slodge

UI Syntax

Page 21: Mvvm crossevent basics

@slodge

Interface Driven Development

Page 22: Mvvm crossevent basics

@slodge

MyViewModel

Needs Location

Needs SQL

Needs Calculator

The Container

My TaxCalculator

Windows Phone Location

Inversion of Construction (Inversion of Control)

Windows Phone SQL

Page 23: Mvvm crossevent basics

@slodge

MyViewModel

Needs Location

Needs SQL

Needs Calculator

The Container

My TaxCalculator

iOS Location

Inversion of Construction (Inversion of Control)

iOS SQL

Page 24: Mvvm crossevent basics

@slodge

Mvx.Register<T>

The Container

(Mvx)

Page 25: Mvvm crossevent basics

@slodge

Automatic Registration

Page 26: Mvvm crossevent basics

@slodge

Mvx.Resolve<T>

Page 27: Mvvm crossevent basics

@slodge

Mvx Construction• Constructor resolution

Page 28: Mvvm crossevent basics

@slodge

Nuget packages

Page 29: Mvvm crossevent basics

@slodge

TipCalc Demo