Reply to comment

Event handlers vs. control properties

You are correct. You don't need to set BindingSource to communicate with the view model. The Get and Set event handlers just need to reference the view model.

I find writing Get/Set events to be a reasonable trade-off. I'll even do that if my form does not exhibit inter-dependency.

The traditional way of working with Windows Forms applications is to load up control properties with initial values when the form loads, and then copy the values out of those properties when you're done. The control properties store your user's data while they work with it.

The Update Controls way is to bind the controls to the model (possibly through a view model) with the Get/Set events. The model stores your user's data, not the control properties.

I find this to be a reasonable trade-off because I don't have to write the load/unload code. It ends up being more lines-of-code to say the same thing, but it gives me the flexibility to add inter-dependent behavior later should I need it.

Reply

By submitting this form, you accept the Mollom privacy policy.