Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Developing WPF software without MVVM

Tags:

mvvm

wpf

We want to start develop an intermediate desktop software. We decided to use the WPF. We don't want to use the MVVM pattern. Because we are not familiar with MVVM, and also have time limits. Is it true to develop WPF application without MVVM pattern (using 3 layer architecture but without MVVM) Although does it have better performance than win forms yet ?

like image 858
mahboub_mo Avatar asked Jan 14 '12 17:01

mahboub_mo


1 Answers

You don't need to rely on MVVM when using wpf. Really the keys to using wpf properly are:

  • use commands instead of events (you might do this without realizing it, but check to make sure)
  • Use data binding instead of getting values off of controls directly
  • Set the data context and bind to that instead of binding to the code behind

MVVM works really well for these two things but is not required. Specifically, MVVM requires a 3-tier strict separation of concerns that can just as easily be done with MVP.

As far as performance is concerned, that really depends on the platform on which the app is run and the coding style. If you run it on a computer without a decent graphics card then winForms will probably perform better because wpf will probably revert to software rendering which will be very slow. If you need to do 3d graphics then wpf is really your only option.

Someone else's recommendation to NOT use MVVM.

A codeproject example of how to do MVP with wpf

like image 111
N_A Avatar answered Sep 22 '22 11:09

N_A