Windows Phone App with MVVM design patten

605 views

Published on

This slides describes about how to create a Windows Phone application with MVVM design pattern.

Published in: Technology
1 Comment
0 Likes
Statistics
Notes
  • Be the first to like this

No Downloads
Views
Total views
605
On SlideShare
0
From Embeds
0
Number of Embeds
9
Actions
Shares
0
Downloads
16
Comments
1
Likes
0
Embeds 0
No embeds

No notes for slide

Windows Phone App with MVVM design patten

  1. 1. /* Life runs on code */
  2. 2. UNDERSTANDING THE MODEL-VIEW- VIEWMODEL PATTERN Kamalakannan Annamalai Senior Software Engineer Ilink-Systems http://kamalakannana.wordpress.com
  3. 3. WHAT IS MVVM? • A weird acronym – Model – View – ViewModel • Woven into WPF/SL/WP • Some confusion: – MVVM is really just the pattern – The rest are helpers, practices, etc. • Why does MVVM pattern is best for WPF/SL/WP? -WPF/SL/WP Controls are developed using MVVM internally.
  4. 4. THE MVC PATTERN Model View Controller
  5. 5. THE PASSIVE VIEW PATTERN Model View Controller
  6. 6. THE PRESENTATION MODEL PATTERN Model View Presentation Model (ViewModel) DataBinding
  7. 7. BLENDABILITY • Testability, Maintainability, Blendability • “The ability to be edited in Blend” –(and Visual Studio designer…) • Differentiate code in design and runtime • Create design time data /* Life runs on code */ 7
  8. 8. BRIDGING THE GAP /* Life runs on code */ 8 View ViewModel DataBinding Commands Messages Model
  9. 9. BRIDGING THE GAP /* Life runs on code */ 9 View ViewModel View ViewModel View ViewModel
  10. 10. DEMO © 2010 IdentityMine Inc. All Rights Reserved. 10Page: Hello MVVM (and Hi Blend)
  11. 11. COMMANDS • “Point of entry” for a method • Can be data bound • ICommand interface –Execute method –CanExecute method –CanExecuteChanged event /* Life runs on code */ 11
  12. 12. FLAWS OF MVVM • – – • • •
  13. 13. DEBUNK THE MYTHS • “No code in the code behind” – “If you put code in the View's code-behind, the MVVM police will take your family away” – “No need for converters” • “MVVM is suitable for big projects” • “MVVM costs performance” • “MVVM is complex / makes my head hurt” /* Life runs on code */ 13
  14. 14. DEBUNK THE MYTHS • “I don’t need separation because I don’t have a designer” • “You cannot use MVVM with other patterns” • “MVVM will make you rich and attractive” /* Life runs on code */ 14
  15. 15. MVVM LIGHT TOOLKIT • “Breaking the monotony” • http://www.galasoft.ch/mvvm/getstarted • http://mvvmlight.codeplex.com • Keep it small • Keep it simple /* Life runs on code */ 15
  16. 16. MVVM LIGHT TOOLS • Project templates (VS + Blend) • Item templates (VS + Blend) • Code snippets /* Life runs on code */ 16
  17. 17. THANKS!

×