SlideShare a Scribd company logo
1 of 15
Intro to MVVM
           Dareen Alhiyari
         Senior Consultant
            Dareen@Softact.com
       Dareen.Alhiyari@gmail.com
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
Model

It is your data or classes that represent
entities in your application. It normally
contains no WPF-specific code.
  • Entity
  • Service Proxy
  • POCO (Plain Old CLR Object)
View

This is the User Interface element visible to
the user. Its DataContext is its ViewModel.
    • XAML (WPF)
    • XAML with Code Behind (Silverlight)
ViewModel
It contains all the data that needs to be
displayed and procedures to modify the model
at will. The magic about MVVM is that the
ViewModel knows nothing about the View.
    • State
    • Operations
    • Not dependent on the view
MVVM Relations

           ViewModel

Commands


            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 Interaction


We always have had commands in WPF. MVVM
leverages on this feature. Instead of writing event
handling code for button clicks, we bind the buttons
(or MenuItems) in the View to Commands in the
ViewModel.
Commands
Commands
MVVM vs. MVC (Model-View-Controller)

MVVM                            MVC
   View
                                          View
 *                                    *
                            1
      1
ViewModel          Controller




                                          Model
 Model
Benefits of MVVM


• Loose coupling
• Testable code
• Maintainable code
Some MVVM Frameworks
Check 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
     Dareen@Softact.com
Dareen.Alhiyari@gmail.com

More Related Content

What's hot

DevOps Tutorial For Beginners | DevOps Tutorial | DevOps Tools | DevOps Train...
DevOps Tutorial For Beginners | DevOps Tutorial | DevOps Tools | DevOps Train...DevOps Tutorial For Beginners | DevOps Tutorial | DevOps Tools | DevOps Train...
DevOps Tutorial For Beginners | DevOps Tutorial | DevOps Tools | DevOps Train...
Simplilearn
 

What's hot (20)

Design Pattern - MVC, MVP and MVVM
Design Pattern - MVC, MVP and MVVMDesign Pattern - MVC, MVP and MVVM
Design Pattern - MVC, MVP and MVVM
 
Introduction to mvc architecture
Introduction to mvc architectureIntroduction to mvc architecture
Introduction to mvc architecture
 
Clean architecture
Clean architectureClean architecture
Clean architecture
 
Architectural Patterns and Software Architectures: Client-Server, Multi-Tier,...
Architectural Patterns and Software Architectures: Client-Server, Multi-Tier,...Architectural Patterns and Software Architectures: Client-Server, Multi-Tier,...
Architectural Patterns and Software Architectures: Client-Server, Multi-Tier,...
 
Basics of VueJS
Basics of VueJSBasics of VueJS
Basics of VueJS
 
MVC ppt presentation
MVC ppt presentationMVC ppt presentation
MVC ppt presentation
 
VueJS: The Simple Revolution
VueJS: The Simple RevolutionVueJS: The Simple Revolution
VueJS: The Simple Revolution
 
ASP.NET MVC.
ASP.NET MVC.ASP.NET MVC.
ASP.NET MVC.
 
Asp.net MVC training session
Asp.net MVC training sessionAsp.net MVC training session
Asp.net MVC training session
 
Vue.js
Vue.jsVue.js
Vue.js
 
DevOps Tutorial For Beginners | DevOps Tutorial | DevOps Tools | DevOps Train...
DevOps Tutorial For Beginners | DevOps Tutorial | DevOps Tools | DevOps Train...DevOps Tutorial For Beginners | DevOps Tutorial | DevOps Tools | DevOps Train...
DevOps Tutorial For Beginners | DevOps Tutorial | DevOps Tools | DevOps Train...
 
Mvc vs mvp vs mvvm a guide on architecture presentation patterns
Mvc vs mvp vs mvvm  a guide on architecture presentation patternsMvc vs mvp vs mvvm  a guide on architecture presentation patterns
Mvc vs mvp vs mvvm a guide on architecture presentation patterns
 
Spring MVC Framework
Spring MVC FrameworkSpring MVC Framework
Spring MVC Framework
 
An introduction to Vue.js
An introduction to Vue.jsAn introduction to Vue.js
An introduction to Vue.js
 
Clean Architecture Essentials - Stockholm Software Craftsmanship
Clean Architecture Essentials - Stockholm Software CraftsmanshipClean Architecture Essentials - Stockholm Software Craftsmanship
Clean Architecture Essentials - Stockholm Software Craftsmanship
 
How to go about testing in React?
How to go about testing in React? How to go about testing in React?
How to go about testing in React?
 
Spring mvc
Spring mvcSpring mvc
Spring mvc
 
Intro to vue.js
Intro to vue.jsIntro to vue.js
Intro to vue.js
 
Java Spring framework, Dependency Injection, DI, IoC, Inversion of Control
Java Spring framework, Dependency Injection, DI, IoC, Inversion of ControlJava Spring framework, Dependency Injection, DI, IoC, Inversion of Control
Java Spring framework, Dependency Injection, DI, IoC, Inversion of Control
 
Single Page Application (SPA) using AngularJS
Single Page Application (SPA) using AngularJSSingle Page Application (SPA) using AngularJS
Single Page Application (SPA) using AngularJS
 

Viewers also liked

Introducing Pebble SDK 2.0
Introducing Pebble SDK 2.0Introducing Pebble SDK 2.0
Introducing Pebble SDK 2.0
Cherie Williams
 

Viewers also liked (8)

VueJS Introduction
VueJS IntroductionVueJS Introduction
VueJS Introduction
 
Javascript MVVM with Vue.JS
Javascript MVVM with Vue.JSJavascript MVVM with Vue.JS
Javascript MVVM with Vue.JS
 
New Mv Presentation
New Mv PresentationNew Mv Presentation
New Mv Presentation
 
Spring 3 MVC CodeMash 2009
Spring 3 MVC   CodeMash 2009Spring 3 MVC   CodeMash 2009
Spring 3 MVC CodeMash 2009
 
Introducing Pebble SDK 2.0
Introducing Pebble SDK 2.0Introducing Pebble SDK 2.0
Introducing Pebble SDK 2.0
 
Software architectural design patterns(MVC, MVP, MVVM, VIPER) for iOS
Software architectural design patterns(MVC, MVP, MVVM, VIPER) for iOSSoftware architectural design patterns(MVC, MVP, MVVM, VIPER) for iOS
Software architectural design patterns(MVC, MVP, MVVM, VIPER) for iOS
 
Big Data Tutorial For Beginners | What Is Big Data | Big Data Tutorial | Hado...
Big Data Tutorial For Beginners | What Is Big Data | Big Data Tutorial | Hado...Big Data Tutorial For Beginners | What Is Big Data | Big Data Tutorial | Hado...
Big Data Tutorial For Beginners | What Is Big Data | Big Data Tutorial | Hado...
 
SlideShare 101
SlideShare 101SlideShare 101
SlideShare 101
 

Similar to MVVM - Model View ViewModel

Advanced MVVM in Windows 8
Advanced MVVM in Windows 8Advanced MVVM in Windows 8
Advanced MVVM in Windows 8
Gill Cleeren
 

Similar to MVVM - Model View ViewModel (20)

Adopting MVVM
Adopting MVVMAdopting MVVM
Adopting MVVM
 
MVVM and Prism
MVVM and PrismMVVM and Prism
MVVM and Prism
 
Mobile App Architectures & Coding guidelines
Mobile App Architectures & Coding guidelinesMobile App Architectures & Coding guidelines
Mobile App Architectures & Coding guidelines
 
Models used in iOS programming, with a focus on MVVM
Models used in iOS programming, with a focus on MVVMModels used in iOS programming, with a focus on MVVM
Models used in iOS programming, with a focus on MVVM
 
Prism library and MVVM
Prism library and MVVMPrism library and MVVM
Prism library and MVVM
 
A Smooth Transition to HTML5 Using MVVM
A Smooth Transition to HTML5 Using MVVMA Smooth Transition to HTML5 Using MVVM
A Smooth Transition to HTML5 Using MVVM
 
Mvc part 1
Mvc part 1Mvc part 1
Mvc part 1
 
Building databound JavaScript apps with Knockoutjs
Building databound JavaScript apps with KnockoutjsBuilding databound JavaScript apps with Knockoutjs
Building databound JavaScript apps with Knockoutjs
 
Understanding The MVVM Pattern (TechDays Belgium)
Understanding The MVVM Pattern (TechDays Belgium)Understanding The MVVM Pattern (TechDays Belgium)
Understanding The MVVM Pattern (TechDays Belgium)
 
Advanced MVVM in Windows 8
Advanced MVVM in Windows 8Advanced MVVM in Windows 8
Advanced MVVM in Windows 8
 
MVC.pptx
MVC.pptxMVC.pptx
MVC.pptx
 
MVP Clean Architecture
MVP Clean  Architecture MVP Clean  Architecture
MVP Clean Architecture
 
MVC architecture by Mohd.Awais on 18th Aug, 2017
MVC architecture by Mohd.Awais on 18th Aug, 2017MVC architecture by Mohd.Awais on 18th Aug, 2017
MVC architecture by Mohd.Awais on 18th Aug, 2017
 
A Smooth Transition to HTML5
A Smooth Transition to HTML5A Smooth Transition to HTML5
A Smooth Transition to HTML5
 
Xamarin user group san diego - mvvm cross
Xamarin user group san diego - mvvm crossXamarin user group san diego - mvvm cross
Xamarin user group san diego - mvvm cross
 
MVC architecture
MVC architectureMVC architecture
MVC architecture
 
Architectural Design & Patterns
Architectural Design&PatternsArchitectural Design&Patterns
Architectural Design & Patterns
 
WPF For Beginners - Learn in 3 days
WPF For Beginners  - Learn in 3 daysWPF For Beginners  - Learn in 3 days
WPF For Beginners - Learn in 3 days
 
MVVM for Modern Applications
MVVM for Modern ApplicationsMVVM for Modern Applications
MVVM for Modern Applications
 
Web engineering - MVC
Web engineering - MVCWeb engineering - MVC
Web engineering - MVC
 

Recently uploaded

Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Victor Rentea
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Victor Rentea
 

Recently uploaded (20)

How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
 
Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
WSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering DevelopersWSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering Developers
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
 
Vector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptxVector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptx
 
Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..
 
Introduction to use of FHIR Documents in ABDM
Introduction to use of FHIR Documents in ABDMIntroduction to use of FHIR Documents in ABDM
Introduction to use of FHIR Documents in ABDM
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot ModelMcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
 
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
 

MVVM - Model View ViewModel

  • 1. Intro to MVVM Dareen Alhiyari Senior Consultant Dareen@Softact.com Dareen.Alhiyari@gmail.com
  • 2. What is MVVM • MVVM is a design pattern • MVVM stands for Model-View-ViewModel
  • 3. Design Patterns • Design patterns are a set of guidelines • Design patterns are Not a set of rules
  • 4. Model It is your data or classes that represent entities in your application. It normally contains no WPF-specific code. • Entity • Service Proxy • POCO (Plain Old CLR Object)
  • 5. View This is the User Interface element visible to the user. Its DataContext is its ViewModel. • XAML (WPF) • XAML with Code Behind (Silverlight)
  • 6. ViewModel It contains all the data that needs to be displayed and procedures to modify the model at will. The magic about MVVM is that the ViewModel knows nothing about the View. • State • Operations • Not dependent on the view
  • 7. MVVM Relations ViewModel Commands Binding View Model
  • 8. 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.
  • 9. User Interaction We always have had commands in WPF. MVVM leverages on this feature. Instead of writing event handling code for button clicks, we bind the buttons (or MenuItems) in the View to Commands in the ViewModel.
  • 12. MVVM vs. MVC (Model-View-Controller) MVVM MVC View View * * 1 1 ViewModel Controller Model Model
  • 13. Benefits of MVVM • Loose coupling • Testable code • Maintainable code
  • 14. Some MVVM Frameworks Check 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
  • 15. Thank you! Dareen Alhiyari Senior Consultant Dareen@Softact.com Dareen.Alhiyari@gmail.com