1. Introduction to MVVM
Jeremy Likness
Senior Consultant, Project Manager
Twitter: @JeremyLikness
Blog: http://csharperimage.jeremylikness.com/
consulting training debugging wintellect.com
2. what we do
consulting training debugging
who we are
Founded by top experts on Microsoft – Jeffrey Richter, Jeff Prosise, and John Robbins –
we pull out all the stops to help our customers achieve their goals through advanced
software-based consulting and training solutions.
how we do it
Consulting & Debugging Training
• Architecture, analysis, and design services • On-site instructor-led training
• Full lifecycle custom software development • Virtual instructor-led training
• Content creation • Devscovery conferences
• Project management
• Debugging & performance tuning
consulting training debugging wintellect.com
3. Agenda
• What is MVVM?
• Why use MVVM?
• MVVM Frameworks Overview
• What is the Cost?
• Demo
• MVVM Prescription
• Questions
consulting training debugging wintellect.com
5. What is MVVM?
• Do you ever have to start work on an application before the
design team is ready?
• Do you make updates in parallel with the design team?
• Do you unit test your solutions?
• Do you reuse code and components both within and across
projects?
• Do you ever have to change the user interface, and wouldn’t
it be nice to do it without having to hit your code as well?
• MVVM solves these types of problems!
consulting training debugging wintellect.com
6. What is MVVM? The Model
• Domain object
• Data/Information and/or Behavior
• Possible persistence information (id, GUID, etc)
• Separate from “how it got there”
consulting training debugging wintellect.com
7. What is MVVM? The View
• What the user “sees” / experiences
• User-friendly format for presentation
• Multiple inputs (gestures)
• Behaviors
• Events
• Data-bindings
consulting training debugging wintellect.com
8. What is MVVM? The View Model
• The “controller”
• Doesn’t know about the view
• Exposes methods and commands
• Coordinates with services
• “Owns” models, and knows how to retrieve/update them
• Might be used in multiple views
• Can communicate with other view models
consulting training debugging wintellect.com
9. What is MVVM? The View Model
consulting training debugging wintellect.com
10. 10 Reasons to Use MVVM
1. Separation of concerns/de-coupling.
2. Designer/developer workflow.
3. Unit testing.
4. Data-binding.
5. Code reuse.
6. Modularity.
7. Refactoring containment.
8. Extensibility.
9. Tools support (Windows Phone 7, MVVM Light, etc.)
10.Pattern vocabulary.
consulting training debugging wintellect.com
12. How Much Does it Cost?
• Learning Curve (Developers)
• Bigger down payment (architecture, infrastructure)
- Low interest rates and minimum monthly payments!
• Visibility (de-coupling can backfire)
• Duplication of code (e.g. WCF RIA)
consulting training debugging wintellect.com
13. demo
MVVM “Before and After”
consulting training debugging wintellect.com