I am looking for best practices for the complex implementation of user interface logic. I am working on a Windows Forms application, but I believe that in order to solve this problem, any platform should have common templates.
I have several controls in my form, there are lists, buttons, tables, and a tree structure. So, the idea is that depending on the "context" some controls are turned on, while others are turned off. Some may provide some features at this time, while others may not.
It is currently implemented as is. I process events, check for changes (a new node tree is selected, selected pairs of nodes, etc.), and then decides whether to disable or activate some controls. I do not like this approach because the form code looks complicated. And if I need to add more logic, it will become even more complex. It really bothers me, since we are quite mobile, and new features or a lot of changes are the daily norm.
I am trying to separate all this logic from parts (functions), where each function is an object that knows how to check its state, and enable or disable related controls depending on this state.
I do not want to come up with something new and try to find good ideas that are widely used. Please, it is not recommended to use one method of the UpdateUI () method, I believe that nothing will change in the long run.
Thank.
source
share