任务或对话框的Presentation- / ViewModel的外观如何? [英] How does the Presentation-/ViewModel for a Task or Dialog look like?

查看:161
本文介绍了任务或对话框的Presentation- / ViewModel的外观如何?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图移动到Model / ViewModel / View架构,并试图将选择对话框推送到此模式时被卡住。我想分开检索一个选项列表(业务/表示逻辑)和实际的显示/选择机制(视图),以重新使用具有不同视图的前者(例如ComboBox与模态对话框)。

I'm trying to move to a Model/ViewModel/View architecture and got stuck when trying to push selection dialogs to this pattern. I'd like to separate retrieving a list of choices (business/presentation logic) and the actual displaying/choosing mechanism (view) to re-use the former with different views (e.g. ComboBox vs. modal dialog).

这样一个选择任务的ViewModel如何看起来像?或者我试图努力,我应该在View中实现?

How would a ViewModel for such a selection task look like? Or am I trying to hard, and I should implement this in the View only?

推荐答案

你的意思是你想使用实现检索列表?如果是这样,我想你可以在应用层创建一个服务类,并重新使用这个功能..

Do you mean that you would like to use the implementation to retrieve list?? If so, I think you can create a service class in the application layer and reuse the functionality..

这篇关于任务或对话框的Presentation- / ViewModel的外观如何?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆