Your SlideShare is downloading. ×
0
Introduction to MVVM Framework
Introduction to MVVM Framework
Introduction to MVVM Framework
Introduction to MVVM Framework
Introduction to MVVM Framework
Introduction to MVVM Framework
Introduction to MVVM Framework
Introduction to MVVM Framework
Introduction to MVVM Framework
Introduction to MVVM Framework
Introduction to MVVM Framework
Introduction to MVVM Framework
Introduction to MVVM Framework
Introduction to MVVM Framework
Introduction to MVVM Framework
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×
Saving this for later? Get the SlideShare app to save on your phone or tablet. Read anywhere, anytime – even offline.
Text the download link to your phone
Standard text messaging rates apply

Introduction to MVVM Framework

2,737

Published on

It's just an introduction to MVVM framework

It's just an introduction to MVVM framework

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
2,737
On Slideshare
0
From Embeds
0
Number of Embeds
1
Actions
Shares
0
Downloads
93
Comments
0
Likes
0
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
No notes for slide

Transcript

  • 1. Introduction to MVVM<br /> In Silverlight<br />Honeyson Joseph D<br /> http:/facebook.com/honeydev<br />1<br />http:/facebook/honeydev<br />
  • 2. What is MVVM ??<br /><ul><li> MVVM is nothing but a Pattern.
  • 3. Also known as Presentational Model.
  • 4. Model-View-ViewModelpattern is similar to MVC</li></ul>2<br />http:/facebook/honeydev<br />
  • 5. Let’s see some variations of similar patterns<br />MVC Pattern<br /><ul><li>Model View Controller is probably the oldest pattern.
  • 6. Still using widely, especially with ASP.NET MVC.</li></ul>3<br />http:/facebook/honeydev<br />
  • 7. Passive View Pattern<br /><ul><li>View is completely Passive.
  • 8. The controller has lot of responsibilities.
  • 9. Testing a View is very difficult and time consuming.</li></ul>4<br />http:/facebook/honeydev<br />
  • 10. Presentation Model Pattern(MVVM)<br /><ul><li> Controlleris replaced with ViewModel.
  • 11. Viewis more active and pushing information to the Model.
  • 12. The interactions is done via Data Binding.</li></ul>5<br />http:/facebook/honeydev<br />
  • 13. 6<br />http:/facebook/honeydev<br />
  • 14. Model<br />Model represents the business domain which includes the<br />model classes used (Customer, Order, etc.), data access<br />code and business rules.<br />7<br />http:/facebook/honeydev<br />
  • 15. View<br /> Viewin MVVM represents the screens that we build.<br />Includes :<br /> 1.XAML files<br /> 2.code-beside files<br /> Responsibilities : <br /> 1.displaying data <br /> 2.collecting data from end users <br /> View isn't responsible for retrieving data, performing any <br /> business rules or validating data<br />8<br />http:/facebook/honeydev<br />
  • 16. ViewModel<br />ViewModel acts as middle-man between View and Model<br />Responsibilities : <br /> Aggregating and storing data that will be bound to a View<br />9<br />http:/facebook/honeydev<br />
  • 17. Helpers around MVVM…<br /><ul><li>Commands
  • 18. Messages</li></ul>10<br />http:/facebook/honeydev<br />
  • 19. Helpers around MVVM…cont<br />View might need to notify the ViewModelabout something happened in the View.<br /> eg: a control being clicked.<br />ViewModelneed to notify to the View when something happen. <br />For these we use Events, another good way is to use Messages.<br />11<br />http:/facebook/honeydev<br />
  • 20. MVVM in Silverlight<br /><ul><li> We use MVVM Light Tools V.x
  • 21. This is an open source MVVM very light Framework with 2 </li></ul> DLLs<br />Components<br /><ul><li>RelayCommand
  • 22. Messenger
  • 23. ViewModelBase. </li></ul>Also<br />1. EventToCommandwhich can be used to get rid of annoying<br />WPF and SL Command binding limitations.<br />2. DispatcherHelperfor multi-threaded applications.<br />12<br />http:/facebook/honeydev<br />
  • 24. For Example<br /> Step 1<br />VIEW<br />Button Base.Command connects view with ViewModel (GetPersonreturntype is Icommand—comand object)- following Commn design pattern<br />VIEW Model<br />PersonViewModelcontructor connects to PersonModel<br />13<br />http:/facebook/honeydev<br />
  • 25. Model<br />Property changed event results in UI updates – from context (two way binding)<br />14<br />http:/facebook/honeydev<br />
  • 26. References:<br />http://weblogs.asp.net/dwahlin/archive/2009/12/08/getting-started-with-the-mvvm-pattern-in-silverlight-applications.aspx<br />http://www.silverlight.net/learn/tutorials/silverlight-4/using-the-mvvm-pattern-in-silverlight-applications/<br />http://www.astaticstate.com/2010/04/silverlight-4-using-mvvm-patter-ria.html<br />Go on more, share your knowledge that help to others including me……………THANK YOU !<br />15<br />http:/facebook/honeydev<br />

×