如何使用IDataErrorinfo [英] How to use IDataErrorinfo
本文介绍了如何使用IDataErrorinfo的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有一个带有多个文本框(Itemcode,ItemName,Price)的Windows窗体.保存时,我将验证所有字段均已输入到业务层中.如何使用Idataerrorinfo在屏幕上显示错误.请给我一个代码示例.
I have a windows form with several textboxes(Itemcode,ItemName,Price). When going to save I''m validating all the fields have entered in the bussiness layer. How can I use Idataerrorinfo to show errors in the screen. Please give me a code example.
推荐答案
您尝试过使用Google吗?有很多样本.
请看这里,引用好一个:
http://codeblitz.wordpress.com/2009/05/08 /wpf-validation-made-easy-with-idataerrorinfo/ [ http://www.codegod.de/WebAppCodeGod/objectdatasource-and-idataerrorinfo- with-winforms-AID427.aspx [ ^ ].
请尽自己所能,并帮个忙:发挥您的Google技能.
祝你好运,
—SA
Did you try to Google for the that? There are plenty of samples.
Please see this, quote good one:
http://codeblitz.wordpress.com/2009/05/08/wpf-validation-made-easy-with-idataerrorinfo/[^].
That one was for WPF (why, why din''t you tag the library you want to use?! Just to force me into doing double work?).
This is forSystem.Windows.Forms
:
http://www.codegod.de/WebAppCodeGod/objectdatasource-and-idataerrorinfo-with-winforms-AID427.aspx[^].
Please do yourself and all of use a favor: work at your Google skills.
Good luck,
—SA
这篇关于如何使用IDataErrorinfo的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文