开发者

How to manage cascading GUI changes in winforms?

开发者 https://www.devze.com 2023-02-17 13:33 出处:网络
In the application I\'m working on, there a开发者_运维百科re a lot of dependencies between GUI fields. For example, when the user changes the value in a textbox, other controls on the form need to cha

In the application I'm working on, there a开发者_运维百科re a lot of dependencies between GUI fields. For example, when the user changes the value in a textbox, other controls on the form need to change based on the new value, which in turn may or may not trigger other changes on the form. These relationships can get arbitrarily complicated, and user requirements change frequently.

I know there are patterns such as MVC to separate out business logic into a controller, but I think the problem I'm trying to solve is different, because it is the logic itself that gets complicated. It seems the relationships can be modeled as a directed graph with each GUI control being a node. I was wondering if this was the right way to approach it and if there are any frameworks out there before I try rolling my own.


We use an 'Appearance Model' to have the controller update the state of that model, and the view updates itself based on the appearance model only.

MyAppModel.MyControl.Readonly = true;

that would be bound to a controls readonly property on the view.

so now based on some event I can flick these states on /off to change the view.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号