Silverlight / 显示一条记录的数据表单 / 甚至可以使用什么

发布于 2024-08-20 00:53:38 字数 381 浏览 5 评论 0原文

警告 - Silverlight / RIA 服务 / 等新手。

我有一个业务要求,需要显示带有单个记录的 DataForm。在网络上的几乎所有示例中,数据表单都与 selecteditem 属性上的数据网格相关联。

就我而言,该表单没有可以绑定的网格。

我知道我正在使用 ViewModel 检索数据,但我需要回调以了解数据何时到达,以便数据表单“重新绑定”(用 Winform 说话!)。我也没有使用 DomainDataSource,因为我想将所有内容保留在 ViewModel 后面。

我创建了一个CurrentXXXX属性,只有数据到达后才能设置。

有一个 IsLoading 属性,但是您什么时候知道数据已到达 ViewModel 中?如何让视图重新绑定?

Warning - new to Silverlight / RIA Services / etc.

I have a business requirement to show a DataForm with a single record. In nearly all the examples on the net the dataform is tied to a datagrid on the selecteditem property.

In my case, the form has no grid to tie to.

I know that I'm retrieving data with my ViewModel, but I need a call back to know when the data has arrived in order for the data form to "re-bind" (Winform speak!). I am also NOT using the DomainDataSource, as I would like to keep everything behind the ViewModel.

I created a CurrentXXXX property, which can only be set after the data arrives.

There is a IsLoading property, but when do you know that data has arrived in the ViewModel? How do you get the View to rebind?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

自我难过 2024-08-27 00:53:38

如果您的VM实现了INotifyPropertyChanged(它应该),那么您不需要重新绑定,因为VM将使用它来通知视图它已更改。

If your VM implements INotifyPropertyChanged (which it should) then you don't need to rebind as the VM will use this to notify the View that it's changed.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文