Recently I've been looking into many of the diffeerent options for creating WPF application using the MVVM pattern/framework style. I do quite like the look of Caliburn Micro but I have a couple of issues with that at the moment:

  • Lack of Unit Tests: I saw a couple of comments saying that it is hard to create them but the MVVM Light toolkit has managed to create over 400. Though obviously quantity doesn't automatically mean quality. But I think it would be hard for a business to feel confident in using it without some testing system. This would easily be a whole discussion in its own right so I'll leave it at that.
  • Conversion over configuration: I like the idea and it makes the actual app code easier but I guess this could be one of the points that make this project harder to unit test. I also wonder if the amount of reflection it uses would risk causing performance issues in larger applications. Testing this would be the best way to have proof that there is no issue which would take time before I would be confidant in using it in a large application.

Overall I think it looks to be a promising project that I may try out soon in a personal project. But I have a upcoming project at work that will be the first to use WPF. In this situation I don't think it would be good to use something that does not have any tests and I cannot find any projects that state they use it (closed or open source). I'm sure there are plenty out there but if I cannot find any examples then its hard to know how well it might work.

So I continued my searching. Today I've come across a few things that I think might help. The central part is that that I'm looking at using the MVVM Light toolkit since it has unit tests and is a simpler system. The following are areas that I am going to explore later when I have time:

    • This post suggests looking at the Cinch MVVM project's services, in V2 that would be IUIVisualizerService for general windows but there are others that might be useful.
    • This post suggests using the NotificationMessageAction class of MVVM Light for showing a window/dialog with access to the result.
    • I wonder if you might put this together with the service implementation to make it testable
    • This is unrelated to the windows issue but I thought it might be useful. It talks about validation of data.
    • There is a comment on the page about how business rules should be in the model but still separate to the POCO data objects.
    • I've left it in since the blog looks like it could have some useful content.

So I'm thinking of taking the service idea from Cinch and creating something useful in a test app using MVVM Light. Once I've got something I will post the source. I might go with a typical customer order system as it can be as simple or complex as you like and has good scope for including validation rules.

Tags: WPF | MVVM | Learning