to make the view itself simpler
to help a view control some distinct part of its behavior
context: we have a Trade screen that has seven different states depending upon whether you're creating or reviewing a Trade. The various user actions available on the screen differ from the state to state. As the screen changes state either upon opening the screen or a result of user actions while it's open we need to enable/disable and show/hide different screen elements.
fluent interface:
stateManager.OnState(TradeDetailState.Review)
.Show(updateTradeButtonPanel)
.IsReadOnly()
.Enable(
editTradeButton,
statusCheckBox,
Status2CheckBox,
cancelTradeButton);
to help a view control some distinct part of its behavior
context: we have a Trade screen that has seven different states depending upon whether you're creating or reviewing a Trade. The various user actions available on the screen differ from the state to state. As the screen changes state either upon opening the screen or a result of user actions while it's open we need to enable/disable and show/hide different screen elements.
fluent interface:
stateManager.OnState(TradeDetailState.Review)
.Show(updateTradeButtonPanel)
.IsReadOnly()
.Enable(
editTradeButton,
statusCheckBox,
Status2CheckBox,
cancelTradeButton);