What is the best MVVM framework for WPF applications?

I am starting with WPF. Before developing a project of medium and large sizes best of all on WPF, I need to work with open source / free MVVM infrastructure for WPF, so please tell me which MVVM framework is the right choice for WPF applications with which I can develop a very attractive interface for enterprise applications, and which comes with a good tutorial and lots of code examples to familiarize yourself with the flow of structure. Please discuss in detail. Thank you

+43
wpf mvvm
Feb 21 '11 at 18:32
source share
3 answers

This question is really difficult to answer objectively, because what is best for you depends on your requirements and preferences. I myself used two frameworks, so these are the ones I can talk about.

One of the most popular MVVM frameworks is the MVVM Light Toolkit , which is a universal framework that allows you to create applications the way you want. This helps to cope with some of the main causes of pain when creating MVVM applications, but for this you need to write a lot of template code yourself. This may be useful for the new WPF developer, as he does not hide as much of the WPF infrastructure.

My personal favorite is Caliburn.Micro , which is a self-confident MVVM framework for WPF, Silverlight, and Windows Phone 7. It uses an overconfiguration convention that saves you from writing a lot of boring, tedious plumbing code. It also means that it requires you to agree with a framework opinion - if you do not follow the conventions that it prescribes, you will struggle with a difficult battle so that everything works.

Caliburn.Micro also has quality work, and if you really don't understand what is happening under the hood, everything may seem a little magical. This is great while everything is working. But when they don’t do this, or you need to do something, the framework is not designed for this, you will need a fairly clear understanding of WPF to find your guidelines.

You need to evaluate the capabilities of various frameworks and toolkits and decide for yourself.

+53
Feb 21 '11 at 18:43
source share

There are many popular open source MVVM frameworks.

Probably the three most popular: MVVM Light , Caliburn or Prism (which, since v4, supports and provides MVVM examples). All three have strengths and weaknesses, and they are all good.

Prism has the advantage of being a "Microsoft" (sponsored) product, as it is represented by the Microsoft Patterns and Practices group. This tends to facilitate adoption at many large enterprises. This, as they say, is also much more and more complicated than other popular options, especially since its purpose is not just the "MVVM Framework", but rather a general-purpose library for developing complex applications.




I am starting to work with WPF.

I also thought that I want to mention - before you choose a framework, I will spend some time really learning and understanding MVVM. I wrote a series to help migrate to WPF with MVVM from Windows Forms , which may make a difference.

It is often difficult to choose a framework until you understand what it really does. Most MVVMs can be done very easily, without any frameworks. Utilities are added to the frameworks that make it easier to manage certain pain points of MVVM development, for example, MVVM Light has an excellent Messenger class that helps in exchanging data between ViewModels, which can be complicated at times. Caliburn has great tools for convenience, etc. However, until you understand the basics, choosing a toolbox can make your life more complicated, rather than simple.

+80
Feb 21 '11 at 18:43
source share

Maybe in order to enjoy MVVM you don’t need to use any libraries at all? It's easy to implement the basic things (DelegateCommand and the class for receiving property notifications are all you need), but it will help you understand MVVM without introducing any library. You will probably encounter some obstacles during this implementation, and you will have to solve it yourself, without any third-party libraries. I believe that this can help you develop a clearer understanding of the structure of MVVM (of course, if you have good guidance), but without introducing the specific features provided by the libraries.

Maybe I'm a little wheel inventor, but I still don't use any MVVM libraries. I just don’t see anything good they can provide to represent another library in the project. Usually, it doesn't take much to implement the basic material needed for MVVM, but in the end you get very flexible code (because all the code belongs to you).

+23
Feb 21 '11 at 18:43
source share



All Articles