windows phone 8 (mvvm)
TRANSCRIPT
![Page 2: Windows phone 8 (mvvm)](https://reader036.vdocuments.us/reader036/viewer/2022082605/554f4aabb4c905423f8b4ca0/html5/thumbnails/2.jpg)
What is MVVM ?
MVVM is a design patterndesign pattern
MVVM stands for Model-View-ViewModel Model-View-ViewModel
![Page 3: Windows phone 8 (mvvm)](https://reader036.vdocuments.us/reader036/viewer/2022082605/554f4aabb4c905423f8b4ca0/html5/thumbnails/3.jpg)
The ViewRepresents the user interface that the user will
seeCan be a page, user control or Data Template
Clean code-behindOnly visual logic (all the rest should go in
the ViewModel)Should never contain anything that is to be
testedModel-related
![Page 4: Windows phone 8 (mvvm)](https://reader036.vdocuments.us/reader036/viewer/2022082605/554f4aabb4c905423f8b4ca0/html5/thumbnails/4.jpg)
The ModelData model, service reference/proxy classes,
Very often, an extra layer is added on top of the generated proxy classes
Validation logicData accessNo reference to ViewModel
![Page 5: Windows phone 8 (mvvm)](https://reader036.vdocuments.us/reader036/viewer/2022082605/554f4aabb4c905423f8b4ca0/html5/thumbnails/5.jpg)
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
![Page 6: Windows phone 8 (mvvm)](https://reader036.vdocuments.us/reader036/viewer/2022082605/554f4aabb4c905423f8b4ca0/html5/thumbnails/6.jpg)
Data ModelData Model
ViewView
XAML
Code-BehindCode-Behind
View ModelView Model
State + State + OperationsOperations
Send notification
Data-binding and commands
Change notification
![Page 7: Windows phone 8 (mvvm)](https://reader036.vdocuments.us/reader036/viewer/2022082605/554f4aabb4c905423f8b4ca0/html5/thumbnails/7.jpg)
MVVM MVC
**11**
11
![Page 8: Windows phone 8 (mvvm)](https://reader036.vdocuments.us/reader036/viewer/2022082605/554f4aabb4c905423f8b4ca0/html5/thumbnails/8.jpg)
viewmodel
navigation
resourcesweb
services
hardware
![Page 9: Windows phone 8 (mvvm)](https://reader036.vdocuments.us/reader036/viewer/2022082605/554f4aabb4c905423f8b4ca0/html5/thumbnails/9.jpg)
Benefits of MVVM
Loose coupling Testable code Maintainable code
![Page 10: Windows phone 8 (mvvm)](https://reader036.vdocuments.us/reader036/viewer/2022082605/554f4aabb4c905423f8b4ca0/html5/thumbnails/10.jpg)
Thank You!