1 / 11

An Introduction to the Model-View- ViewModel Pattern

An Introduction to the Model-View- ViewModel Pattern. rakeshk@damcogroup.com rakesh308@gmail.com. WPF. Intoduced in 3Framework 3.0. XAML UI Language. Vector Based rendering. Rich Composition ……………. ……………. ……………. TWO WAY DATABINDING. What is MVVM?. M odel V iew V iew M odel.

zubin
Download Presentation

An Introduction to the Model-View- ViewModel Pattern

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. An Introduction to the Model-View-ViewModel Pattern rakeshk@damcogroup.com rakesh308@gmail.com

  2. WPF • Intoduced in 3Framework 3.0. • XAML UI Language. • Vector Based rendering. • Rich Composition • ……………. • ……………. • ……………. • TWO WAY DATABINDING

  3. What is MVVM? • Model • View • ViewModel

  4. Standing on the Shoulders of Giants • MVC • MVP • Martin Fowler • Josh Smith • John Gossman • Sean Wildermuth

  5. Why MVVM? • Separation Of Concerns • Test Driven Approach • Code Cleanliness & Modular Approach • Support WPF two way Data binding feature.

  6. How Do We Achieve that? View ViewModel Model

  7. DONOT FOLLOW THIS View View View ViewModel Model

  8. Bindings A More Complete Diagram Unit Tests Integration Tests View XAML, Code Behind Actions Behavior ViewModel Properties, Commands, View Logic Events Data Model Service Proxies Web

  9. DEMO – SAMPLE

  10. MVVM Guidelines 1. Reduce or eliminate your code-behind 2. Bind all of your UI inputs/outputs to your ViewModel 3. Implement INotifyPropertyChanged on your ViewModel 4. When testing, treat ViewModel as the Real UI 5. Avoid events.  Use commands instead

  11. Third Party Support • Prism • MVVM Light • Caliburn • Silverlight FX

More Related