MVVM - Frameworks
In this chapter, we will discuss the available MVVM toolkits or frameworks. You can also use these frameworks so you don't have to write a bunch of repetitive code to implement the MVVM pattern yourself. Here are some of the most popular frameworks -
- MVVM Light
- Caliburn Micro
Prism provides sample tips and documentation to help you easily design and create Windows Presentation Foundation desktop applications (WPF) rich, flexible and easy to maintain Rich Internet Applications (RIA) built with Microsoft Silverlight browser plug-in and Windows applications.
Prism uses design patterns that embody important architectural design principles, such as problem separation and loose coupling.
Prism helps you design and build create applications using weak componentscoupled which can scale independently but which can be easily and transparently integrated into the overall application.
These types of applications are known as composite applications.
Prism has a number of features out of the box. Here are some of the important features of Prism.
Prism supports the MVVM model. It has a Bindablebase class similar to the one implemented in the previous chapters.
It has a flexible ViewModelLocator which has conventions but allows you to override those conventions and declaratively connect your Views and ViewModels in a loosely coupled fashion.
It 's the possibility of
User interface composition / regions
This is the ability to plug views into containers without the view that does the branching, requiring an explicit reference to the 'container user interface itself.
Prism has navigation features that overlap with regions, such as forward and backward navigation and the navigation stack that allows your for models to participate directly in navigation process.
Prism has commands so they have a delegate command which is very similar to the MyICommand we used in previous chapters except it has extra robustness for protect yourself from memory leaks.
Pub / Sub Events
Prism also supports Pub / Sub events. These are loosely coupled events where the publisher and the subscriber may haveThey have different lives and do not need to have explicit references to each other to communicate via events.
MVVM Light is produced by Laurent Bugnion and helps you separate your view from your model, which creates cleaner applications that are easier to maintain and expand.
It also creates testable applications and allows you to have a much thinner user interface layer (which is more difficult to be tested automatically).
This toolkit places special emphasis on opening and modifying the user interface in Blend, including creating data at design time to allow Blend users to "see something " when working with data controls.
This is another small open-source framework that helps you implementter the MVVM model and also supports a number of out-of-the-box things.
Caliburn Micro is a small but powerful framework, designed to build applications on all XAML platforms.
With strong support for MVVM and other proven user interface models, Caliburn Micro will allow you to build your solution quickly, without having to sacrifice Quality code or testability.