Another idea might be: each control that requires state management implements the AsbtractControl class, which implies that each child element defines its specific notification state .
Add an EventManager to your application that "intercepts" an event received from different controls other than AsbtractControl and click StateStack . by means of a control only "activated" by the user.
Deploy DesitionalEngine , which parses every StateStack action and enables / disables controls in the user interface, as well as the Clears / or Not stack, based on the cancellation made. The reason, in your opinion, can be accomplished with the permission Enable / Disable, based on the actions of several controls.
Just to give you another idea, call somethign similiar, which I implemented many years ago for WinForms.
Hope this helps.
Sincerely.
source share