【发布时间】:2011-10-04 14:14:10
【问题描述】:
我必须重构一个应用程序,它几乎在每个模型和代码隐藏文件中都有一个 serviceclient 实例,其中一些使用 App.xaml.cs (Silverlight 4) 中的 serviceclient 属性
这方面的最佳做法是什么?这样做,所有控件都将使用保存在 app.xaml.cs 中的 serviceclient 实例,还是在每个视图模型/代码隐藏处创建 serviceClient 实例?
在接下来的几周内(我的另一个问题也得到了答案)我需要写一些单元测试,所以我需要记住这一点。
【问题讨论】:
标签: wcf silverlight-4.0 viewmodel service-reference