5 Minute Overview of MVVM in Silverlight
Model-View-ViewModel ( MVVM ) is a pattern to use with Silverlight and WPF.
john gives short explanation of MVVM
MVVM works well with XAML based applications is because of the powerful XAML binding features.
This allows the View to be separated from the data and the logic.
The View can be designed in Expression Blend while the ViewModel can be developed in Visual Studio .NET.
It allows for the presentation to be separated easily.
A View is a class that represents the user interface that the user will see.
In Silverlight this is the MainPage.xaml or Page.xaml class for example.
In Silverlight and WPF the View also contains binding extensions that identify the data points
that will be presented to the user (embedded in XAML).
The bindings are activated when the View’s DataContext is set to a class that contains the source for the bindings.
Model is a class that represents data points describing a specific entity.
The Model’s purpose is to represent the data points and it has no knowledge of
where it will be presented to a user nor how it will be presented.
It’s single responsibility is to represent the data points.
The ViewModel is the glue between the View and the outside world.
The View’s DataContext is set to an instance of a ViewModel class.
This is where all of the bindings declared in the View’s XAML The ViewModel contains the Model,
so it has all of the data points needed in many cases right there.
To learn more, go to URL: http://johnpapa.net/silverlight/5-minute-overview-of-mvvm-in-silverlight/