silverlight视图模型中从RIA服务获取数据
我正在创建 silverlight 应用程序并实现 MVVM 模式。在我的视图模型中,我想从 RIA 服务域类获取数据。通过以下代码,
LoadOperation<DimensionDTO> loadOp = this.parametersDomainContext.Load(this.parametersDomainContext.GetDimensionDTOQuery());
List<DimensionDTO> Dimensions = LoadOperation.Entities as List<DimensionDTO> ;
虽然 RIA 服务正在返回数据,但在第二行调试器中显示实体计数 = 0
根据我,这是因为 RIA 服务的异步调用。在从 ria 服务返回数据之前执行第二行。我怎样才能使这两行同步。我的意思是第二行应该在加载操作完成时执行。
i am creating silverlight application and implementing MVVM pattern. in my view model i want to get data from RIA service domain class. through following code
LoadOperation<DimensionDTO> loadOp = this.parametersDomainContext.Load(this.parametersDomainContext.GetDimensionDTOQuery());
List<DimensionDTO> Dimensions = LoadOperation.Entities as List<DimensionDTO> ;
though RIA service is returning data but in second line debugger shows entity count = 0
according to me this is because of asynchronous calling of RIA service. before return of data from ria service second line is executed. how can i make these two line synchronous. i mean second line should be executed when load operation is finished.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
视图模型中
在您的Silverlight 代码中的
或
in your View Model
in your Silverlight Code
or