DEEP DIVE MVVM Laurent Bugnion Director, UX Integration IdentityMine .

Post on 15-Dec-2015

212 views 0 download

Tags:

Transcript of DEEP DIVE MVVM Laurent Bugnion Director, UX Integration IdentityMine .

DEEP DIVEMVVMLaurent BugnionDirector, UX IntegrationIdentityMine

http://blog.galasoft.ch

LAST YEAR WE…

3Page:

© 2011 IdentityMine Inc. All Rights Reserved.

1. Talked about the history of MVVM

2. Cleared some confusion

3. Refactored a non-MVVM application

4. Made it Blendable

5. Talked about additional components

6. Did a more complex demo

AND THEN CAME THE QUESTIONS…

5Page:

© 2011 IdentityMine Inc. All Rights Reserved.

Q• How do you avoid

redundancy?

• How do you start animations?

• How do you show dialogs?

• How do you do navigation?

• How do you handle multiple VMs?

• How do you test your VMs?

© 2010 IdentityMine Inc. All Rights Reserved. 6Page:

© 2010 IdentityMine Inc. All Rights Reserved. 7Page:

DEMOConnecting to JSON

© 2010 IdentityMine Inc. All Rights Reserved. 9Page:

VIEWMODEL VIEW

ViewModel View

• Complicates the testing, hard coupling

• Hard to design and tweak

MessageBoxAnimationsNavigation

© 2011 IdentityMine Inc. All Rights Reserved. 10Page:

VIEWMODEL VIEW

BehaviourBinding

• Loose coupling, more flexibility

• Behavior is highly Blendable

ViewModel View

© 2011 IdentityMine Inc. All Rights Reserved. 11Page:

INJECTING VIEW SERVICES

ViewModel IDialogService

DialogService View

injection

INavigationService

injection

actionNavigationService

DEMOBehaviours

Injecting View ServicesNavigation

© 2011 IdentityMine Inc. All Rights Reserved. 13Page:

INJECTING VIEW SERVICES

ViewModel IDialogService

DialogService View

injection

INavigationService

injection

actionNavigationService

© 2011 IdentityMine Inc. All Rights Reserved. 14Page:

TESTING THE VIEWMODEL

ViewModel IDialogService

DialogService View

MockDialogServiceUnit Test

DEMOUnit Testing ViewModels

Mocking Services

FURTHER INFORMATIONhttp://blog.galasoft.chhttp://www.galasoft.ch/mvvm/http://mvvmlight.codeplex.comTwitter: @LBugnion #deepdivemvvm

Please fill out your evaluation forms…

THANKS!