我正在使用 RIA 服务在 Silverlight 4 中开发解决方案。我在实体上使用数据注释来描述验证。我可以看到这些在构建后反映在客户端代码上。我有一个子窗口,其中的文本框绑定到单个实体记录以进行编辑。我在所有文本框上的数据注释都是注释,但是直到用户首先编辑文本框、离开文本框、重新输入文本框然后删除内容之前,它不会触发。
如果我试图强迫某人填写文本框,这没有用,因为他们可能会直接跳过带有所需数据注释的文本框。
我在这里缺少一些简单的东西吗?
提前致谢
Im developing a solution in Silverlight 4 with RIA Services. I am using data annotations on my entity to describe validation. I can see these are reflected on the client side code after building. I have a child window which has textboxes bound to a single entity record for editing. The data annotation i have on all the textboxes is the annotation but this does not ever fire until a user has editted a textbox first, left the textbox, re-entered the textbox and then deletes the content.
This has no use if i am trying to force someone to fill in a textbox as they may skip straight over the textbox with the required data annotation.
Am i missing something simple here?
Thanks in advance
发布评论
评论(1)
感谢 Thomas Claudius Huber,我一直在 SL3、4 和 5 中使用这个非常有效的解决方案,没有出现任何问题:http://www.thomasclaudiushuber.com/blog/2009/07/17/here-it-is-the-updatesourcetrigger-for-propertychanged-in-silverlight/
I have been using this very effective solution without any issues in both SL3, 4 and 5, thanks to Thomas Claudius Huber: http://www.thomasclaudiushuber.com/blog/2009/07/17/here-it-is-the-updatesourcetrigger-for-propertychanged-in-silverlight/