Synchronizing objects with GUI controls
2 answers
You can make an object a field in your form. When the corresponding event is fired from the control, invoke the appropriate operation on the object.
Also, you have a Presenter / Controller object that saves your form as a field. It can take it as a parameter in the constructor. This host can then subscribe to your respective events and act accordingly. You can go a step further with this and extract the interface from your form and program to this in a presenter, and this will help testing. Have a look at the MVP pattern.
0
a source to share