MVVM与DataForm - 如何设置非显示字段的值
我正在使用 SL4 和 RIA 服务。我有一个包含 3 个字段的简单表(Name、UpDatedByUserId、UpDatedOn)。在我的元数据中,我对后两个字段使用数据注释,以便它们不显示。我的 DataGrid 和相关的 DataForm 正确显示每条记录,并且根据需要,DataForm 仅显示“名称”字段,但当然我想以编程方式设置其他 2 个字段(UpDatedByUserId 和 UpDatedOn)的值。有没有办法可以在 ViewModel 中设置这些值?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
在您的 ViewModel 中,您可以像这样设置您的 Name 属性:
In your ViewModel you could setup your Name property like so: