2

I 'am building a small windows form application.

I have a View - a simple form that has some functionality in it. a Controller - a class that will react to loading, saving, getting data from the model and prepare it form the view etc. a Model - a class that will get and save data to DB or file.

The controller is creating a form instance an run it, and creating a model instance when needed.

I wonder about how to react in the controller to the view events. Should I register to the view events (buttons click, combo change etc.) ? This will make the form controls visible outside the form?

Maybe I have a mistake in the design?

Majid
  • 13,097
  • 15
  • 74
  • 110
Roy Tsabari
  • 1,960
  • 6
  • 24
  • 40

3 Answers3

1

Microsoft has created a framework for Win Forms MVC applications, the Composite UI Application framework.

http://www.codeplex.com/smartclient

It is probably overkill for a small project, but you could look at it and get some ideas.

Shiraz Bhaiji
  • 62,289
  • 31
  • 137
  • 240
0

If you google MVP (Model-View-Presenter) you'll find info on how to implement a seperation of concerns pattern in a Windows form application.

0

Can you take a look at this SO post using MVC MVP patterns in winforms

Community
  • 1
  • 1
P.K
  • 17,999
  • 11
  • 42
  • 51