Here are a few more thoughts.. You don't need any of the aforementioned libraries to implement MVVM - it's just without some of their features UI interaction (even something as a simple as displaying a message box) and communication between modules can be difficult. Another option is WPF Application Foundation. https://waf.codeplex.com It's not being supported but provides some excellent documentation and samples on a concept of passing a IView interface to the view model: https://waf.codeplex.com/wikipage?title=Model-View-ViewModel%20Pattern&referringTitle=Home This allows you to call view (UI) operations from the view model without violating MVVM. My experience with Prism is version 4, which has been out for years. It's kinda of a all or nothing approach. But Prism 5 breaks it out into separate parts - so you could use the MVVM library and not the Composition library. And as you mentioned it has excellent documentation.
Stein Borge
Posts
-
Starter MVVM Framework Recommendation -
Starter MVVM Framework RecommendationFirst of all, what type of application are you creating? Do you know why you are doing MVVM? A lot of people throw around 'it's great/separation of concerns etc.' without properly taking advantage of underlying strengths of the pattern. Unless you are creating massive applications with big managed teams, skip Prism. I'd go with Caliburn Micro or MVVMLight.. Before making a decision you should create a basic application with a couple of forms, one with one to many/parent child data, a lot of buttons/menus and throw in some mouse/drag click events. This may sound trivial from a traditional Access/VB6 form perspective but can take a lot of work to function successfully in MVVM. You might want to look at this library I did to take out a lot of the pain associated with MVVM https://github.com/steinborge/ProxyTypeHelper While not strictly a framework it greatly simplify view model creation. It works with PRISM and should work with other frameworks. It still maintains full MVVM i.e. no strong couple of view or view model. The following code demonstrates a viewmodel using the library, using the traditional method would be a lot more code.
public string FirstName {get;set;}
public string LastName {get;set;}//FullName property changed event fires if FirstName or LastName
[LinkToProperty("FirstName")] [LinkToProperty("LastName")]
public string FullName
{
get
{
return String.Format("{0} {1}", FirstName, LastName);
}
}[PropertyChangedEvent]
void person_PropertyChanged(object sender, System.ComponentModel.PropertyChangedEventArgs e)
{
//do something
}//call this method if RollBackChangesCommand command fires in view
[LinkToCommand("RollBackChangesCommand")]
private void btnRollBackChanges()
{
}//link to view's data grid AddingNewItem event
[LinkToEvent("AddingNewItemEvent")]
private void DataGrid_AddingNewItem(AddingNewItemEventArgs e)
{
}