Windows phone 8 (mvvm)
-
Upload
ipower-softwares -
Category
Software
-
view
78 -
download
1
Transcript of Windows phone 8 (mvvm)
What is MVVM ?
MVVM is a design patterndesign pattern
MVVM stands for Model-View-ViewModel Model-View-ViewModel
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
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
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
Data ModelData Model
ViewView
XAML
Code-BehindCode-Behind
View ModelView Model
State + State + OperationsOperations
Send notification
Data-binding and commands
Change notification
MVVM MVC
**11**
11
viewmodel
navigation
resourcesweb
services
hardware
Benefits of MVVM
Loose coupling Testable code Maintainable code
Thank You!