Developing WPF software without MVVM

后端 未结 5 992
走了就别回头了
走了就别回头了 2020-12-30 10:05

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 als

5条回答
  •  心在旅途
    2020-12-30 10:48

    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

提交回复
热议问题