WPF数据绑定和验证规则最佳实践 [英] WPF Data Binding and Validation Rules Best Practices
本文介绍了WPF数据绑定和验证规则最佳实践的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
所以我的问题是:有一个很好的示例应用程序文章在哪里展示了在WPF中验证用户输入的最佳做法?
解决方案
我认为新的首选方式可能是使用IDataErrorInfo
阅读更多 here
I have a very simple WPF application in which I am using data binding to allow editing of some custom CLR objects. I am now wanting to put some input validation in when the user clicks save. However, all the WPF books I have read don't really devote any space to this issue. I see that you can create custom ValidationRules, but I am wondering if this would be overkill for my needs.
So my question is this: is there a good sample application or article somewhere that demonstrates best practice for validating user input in WPF?
解决方案
I think the new preferred way might be to use IDataErrorInfo
Read more here
这篇关于WPF数据绑定和验证规则最佳实践的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文