Silverlight / 显示一条记录的数据表单 / 甚至可以使用什么
警告 - 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果您的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.