开发者

Presentation Model

I want to set values for form labels from the controller. Can I send List<String> as parameter and have the fo开发者_如何转开发rm to set individual labels OR set the values for each and every labels from controller class?. I am confused with the level of extracting the logic from the form.


i assume you use Presentation Model pattern (no matter what UI Framework you use).

you can make all of your form label as a single Property (of course with a notification ability) on your Presentation Model and bind it with the Form Label in the view.

If you passing List it would less natural, harder to read and require more code on unit testing.

BUT Form label is View-Specific it will deal with localization or internationalization it would be better to just put it on the view not in the Presentation-Model

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜