Getting started with MVVM

3,175 views
3,048 views

Published on

Slidedeck from "Getting Started with MVVM" presentation at RDU Code Camp 2010.

Published in: Technology
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
3,175
On SlideShare
0
From Embeds
0
Number of Embeds
275
Actions
Shares
0
Downloads
113
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Getting started with MVVM

  1. 1. Getting started with MVVM Model-View-ViewModel Ash Tewari www.ashtewari.com @ashtewari
  2. 2. Introductions • Introductions • Announcements • Share contact information 2
  3. 3. Survey • Do you work with WPF or Silverlight ? • How familiar are you with MVVM ? – Heard about it – Read about it – Played around with it – Used it in a production application 3
  4. 4. Stupid Questions Policy 4
  5. 5. Why ? WPF Features – Data Binding – Data Templates – Resources – Commands 5
  6. 6. Why ? Decouple View from its State and Behavior – Code is easy to understand, maintain, evolve and troubleshoot 6
  7. 7. Why ? Testability – Automated Regressions 7
  8. 8. Why ? Easily skin user interfaces 8
  9. 9. Why ? Designer/Developer Workflow – Allows Specialists to work on the same project without much friction 9
  10. 10. Sample Application • MSDN Magazine Article : http://msdn.microsoft.com/en- us/magazine/dd419663.aspx • Sample Application Download: http://code.msdn.microsoft.com/mag2009 02MVVM/Release/ProjectReleases.aspx 10
  11. 11. Demo Structure of demo application 11
  12. 12. M-V-VM • Model • View • ViewModel 12
  13. 13. Demo Add “Search” feature to the demo application 13
  14. 14. Take Away Model does not know about View and ViewModel. 14
  15. 15. Take Away ViewModel is an abstraction of the View. It encapsulates the State as well as the behavior of the View. 15
  16. 16. Take Away ViewModel does not have a reference to the View. 16
  17. 17. Take Away ViewModel implements INotifyPropertyChanged. 17
  18. 18. Take Away ViewModel is assigned to the DataContext property of the View. 18
  19. 19. Resources • Advanced MVVM Book – http://joshsmithonwpf.wordpress.com/advanced- mvvm/ • BubbleBurst Sample Application – http://bubbleburst.codeplex.com/ 19
  20. 20. Resources • Comparison of MVVM Frameworks – http://www.japf.fr/2009/11/discover-compare- existing-mvvm-frameworks/ • MVVM Light Toolkit – http://www.galasoft.ch/mvvm/getstarted/ 20
  21. 21. Feedback Forms Ash Tewari www.ashtewari.com @ashtewari

×