The Model View ViewModel (MVVM) is an architectural pattern used in software engineering.
It originated from Microsoft as a specialization of the Presentation Model design pattern introduced by Martin Fowler.
Largely based on the Model-view-controller pattern (MVC), MVVM is targeted at modern UI development platforms.
MVVM was designed to make use of specific functions in WPF to better facilitate.
The separation of View layer development from the rest of the pattern by removing virtually all “code behind” from the View layer.
Instead of requiring Interactive Designers to write View code, they can use the native WPF markup language XAML and create bindings to the ViewModel, which is written and maintained by application developers.
This separation of roles allows Interactive Designers to focus on UI needs rather than programming or business logic, allowing for the layers of an application to be developed in multiple work streams.
Model
- The Model represents the actual data and/or information we are dealing with.An example of a model might be a contact (containing name, phone number, address, etc.) or it can be the Web service , Data Access in short anything which provide the data.
- The key to remember with the model is that it holds the information.
ViewModel
- ViewModel is the base in the MVVP pattern.Acts as a “View” specific model class,adapting your model to the need of the view.
- It hold the state of the view.but do not know or hold the reference of the view.View is responsible for hold the reference of the ViewModel.
- Responsible for talking with model/Service through their interfaces.
- The viewmodel may expose the model directly, or properties related to the model, for data-binding
- The ViewModel can also Validate the Data.
- The viewmodel exposes not only models, but also exposes Notifiable Properties, and Observable Collections to the View.The View Binds to these ViewModel entities/members(supported by wpf).
View
- The view is what most of us are familiar with and the only thing the end user really interacts with. It is the presentation of the data.
- The View holds a reference to the ViewModel.View is completely isolated from the model.
- In MVVM ,A View is defined in XAML and should not have any logic in the code-behind. It binds to the view-model by only using data binding.
- The view handles its own UI events, then maps them to the viewmodel via commands.
General
- The view and the viewmodel communicate via data-binding, method calls, properties, events, and messages.
- The models and properties on the viewmodel are updated from the view via two-way databinding.
- When user update the view,Databinding pushes changes to the ViewModel.
- when Model updates ViewModel DataBinding pushes changes to the View.
- The key thing to remember is that you have one and only one ViewModel per view.
Implementations of the MVVM pattern have the following characteristics:
- The View class generates events in response to user interactions, and these events are handled by the corresponding ViewModel class. The View class has no knowledge of how the events are handled, or what impact the events will have on the Model.
- The ViewModel class determines whether a user action requires modification of the data in the Model, and acts on the Model if required. For example, if a user presses a button to update the inventory quantity for a part, the View simply notifies the ViewModel that this event occurred. The ViewModel retrieves the new inventory amount from the View and updates the Model. This decouples the View from the Model, and consolidates the business logic into the ViewModel and the Model where it can be tested.
- The Model notifies the ViewModel if the data in the underlying data store has changed. Generally, when you work with a stateless request/response model, you don’t need to worry about whether data has changed while the request is being processed, since the window of time is small. With rich Internet application (RIA) approaches, the Model data typically stays in memory for longer, and multiple active Views may share the Model data. A user may make changes in one View that affects a different View within the application. The Model fires events to notify any active ViewModels of data changes.
- The ViewModel notifies the View when information has changed. This is typically automated through the two-way binding infrastructure described previously.
Benefits and Consequences of Using MVVM
The benefits of MVVM are the following:
The consequences of MVVM are the following:
Othere Reference :http://msdn.microsoft.com/en-us/library/ff798384.aspx

thnx bro
Great views on that!