-1

I am a C# WinForms developer looking to move to WPF using the MVVM pattern. I see a plethora of questions comparing the various frameworks, but what role do they serve and why do I need one?

EDIT: This is not a duplicate of the linked question. This question addresses frameworks such as PRISM, not MVVM itself.

Gyrien
  • 317
  • 3
  • 8

2 Answers2

3

The various frameworks make implementing MVVM easier, as there is some boilerplate code you need that can be tedious to write repeatedly.

That being said, you absolutely do not need one. You can implement MVVM all on your own and it will work just fine (it isn't even that hard). In fact, you probably should implement it yourself at least once so you know what the framework is doing for you, but thats just my opinion.

BradleyDotNET
  • 60,462
  • 10
  • 96
  • 117
  • How much work does it automate then? I am asking as my development team is currently debating the use of one. – Gyrien Jul 15 '14 at 15:30
  • 1
    @Gyrien I can't speak to it too much, since I almost always rolled my own (it *really* isn't that hard). It might save a bit of typing on the NotifyPropertyChanged pieces, and perhaps do some auto-mapping between the model and view model for data objects. All those functions can be replicated with other tools/libraries though. I would definitely start without a framework, and add one later if you really feel it would help (probably after more research into the ones you are considering). – BradleyDotNET Jul 15 '14 at 15:34
0

If you're from a WinForm background you're probably use to everything being in a 'code behind' style of development - the behaviour of the application is invoked in event handlers for the UI.

IF this is the case your code base has probably become very complex and difficult to maintain and work with everyday. This is one of the problems MVVM or more generally MVC attempts to address by separating out concerns of the Model, View & Controller (ViewModel in the case of MVVM).

I suggest you read up on principles of MVC, MVVM and separation of concern before trying to tackle the implementation details of MVVM.

AwkwardCoder
  • 24,893
  • 27
  • 82
  • 152