Silveright 用户控件验证
我在我的 silverlight 页面之一中遵循 MVVM 模式。 我正在尝试为我的用户控件之一添加验证,该验证应该类似于与 Silverlight 本机控件一起使用的验证。我可以这样做吗?我需要添加特殊代码来处理这个问题吗?
I follow MVVM pattern in one of my silverlight pages.
I am trying to add validations for one of my usercontrols which should look like those which work with the Silverlight native controls. Is it possible for me to do that? Do I need to add special code to handle this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
确保您的 ViewModel 实现了 IDataErrorInfo,然后您可以将它们连接到控件。
您可以在这里查看一篇好文章:
http://www.arrangeactassert。 com/using-idataerrorinfo-for-validation-in-mvvm-with-silverlight-and-wpf/
Make sure your ViewModel implements
IDataErrorInfo
and then you can hook them up to the controls.You can look at a good article here:
http://www.arrangeactassert.com/using-idataerrorinfo-for-validation-in-mvvm-with-silverlight-and-wpf/
如果您可以发布您的代码,那么我也许可以提供帮助。但根据您的问题,我认为 Silverlight 有可用的用户验证控件,您只需拖放即可使用。
它们在大多数新 IDE 中都可用。
if you could post your code then i might be able to help. But as per your question i think there are available user-validation controls for Silverlight that you can just drag and drop and then use.
They are available in most of the new IDE's.