views:

270

answers:

4

All,

As far as I understand ASP.NET MVC is the framework that implements the MVC pattern released my Microsoft. I wonder why there is no Winforms or WPF MVC implementation ? The reason I am asking is that I am planning to start on a new big WinForms project and ideally we are looking for a framework that implements some kind of common pattern to improve the testability of our solution.

Thanks, MK

+1  A: 

If you want to use WPF you should look into using the MVVM pattern (Model View View-Model).

There's a template you can download for Visual Studio for it. It's part of the WPF Toolkit I think. Look on CodePlex.com.

Hope this helps!

Tony
+1  A: 

There are a few similar SO Questions here and here.

Just because there is not a strict framework for MVC in webforms/wpf doesn't mean you can't follow the principles and code in an MVC way. I think MVVM for WPF is similar although I have no experience of this.

Fermin
+2  A: 

For WPF, the MVVM pattern is so deeply ingrained in the framework itself that you don't really see it until someone points it out to you. You don't really need a separate framework for that (although certain types, such as Josh Smith's RelayCommand, would be nice to have in the BCL).

Windows Forms isn't really going anywhere anymore, which is why you don't see any new or thriving MVC-style frameworks for that platform. However, patterns & practices' Composite Application Block (CAB) was an attempt at such a framework.

Most people found the CAB to be too complicated to their taste, but I personally found it a valuable effort, even if it could have been simpler to use. It's still out there and available in source code format, so you might want to take a look at it.

However, if at all possible, implement your application as a WPF application instead.

Mark Seemann
+1  A: 
jeroenh