MVVM - Model View ViewModel
Upcoming SlideShare
Loading in...5

MVVM - Model View ViewModel



An introduction to MVVM design pattern

An introduction to MVVM design pattern



Total Views
Views on SlideShare
Embed Views



30 Embeds 443 209 74 42 13 13 9 8 8 8 8 8 7 7 5 4 3 2 2 2 1 1 1 1 1 1 1 1 1 1 1



Upload Details

Uploaded via as Microsoft PowerPoint

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
Post Comment
Edit your comment

MVVM - Model View ViewModel MVVM - Model View ViewModel Presentation Transcript

  • Intro to MVVM Dareen Alhiyari Senior Consultant
  • What is MVVM• MVVM is a design pattern• MVVM stands for Model-View-ViewModel
  • Design Patterns• Design patterns are a set of guidelines• Design patterns are Not a set of rules
  • ModelIt is your data or classes that represententities in your application. It normallycontains no WPF-specific code. • Entity • Service Proxy • POCO (Plain Old CLR Object)
  • ViewThis is the User Interface element visible tothe user. Its DataContext is its ViewModel. • XAML (WPF) • XAML with Code Behind (Silverlight)
  • ViewModelIt contains all the data that needs to bedisplayed and procedures to modify the modelat will. The magic about MVVM is that theViewModel knows nothing about the View. • State • Operations • Not dependent on the view
  • MVVM Relations ViewModelCommands Binding View Model
  • Loosely Coupled• The View knows the ViewModel but the ViewModel does not know the View.• You can very easily replace the View without affecting the ViewModel.• This is very useful in Developer/Designer teams where the Developer improves the ViewModel and the Designer enhances the View.
  • User InteractionWe always have had commands in WPF. MVVMleverages on this feature. Instead of writing eventhandling code for button clicks, we bind the buttons(or MenuItems) in the View to Commands in theViewModel.
  • Commands
  • Commands
  • MVVM vs. MVC (Model-View-Controller)MVVM MVC View View * * 1 1ViewModel Controller Model Model
  • Benefits of MVVM• Loose coupling• Testable code• Maintainable code
  • Some MVVM FrameworksCheck out this handy tool to compare MVVM frameworks: MVVM Comparison Tool - Silverlight• PRISM (Microsoft) • Core MVVM• MVVM Light (Laurent Bugnion) • Onyx• WPF Application Framework • nRoute• Chinch • MVVM Foundation• Caliburn Micro • How to build your own MVVM Framework
  • Thank you! Dareen Alhiyari Senior Consultant