I have several controls on my form and on changed event the logic entity properties are changed. Is it p开发者_Go百科ossible not to implement changed event for every control,but do it in one place and update my logic entity when user is making changes on the form?
You need to subscribe to Change event of every control, but use the same event handler for all controls. For example, all textboxes can subscribe to the same Change event handler. For other control types, event handlers may have different types, so you can write one event handler per control type. You can also write single function, like OnUpdate, and call it from all event handlers.
精彩评论