<?xml version="1.0" encoding="UTF-8"?><!-- generator="wordpress/wordpress-mu-1.2.1" -->
<rss version="2.0" 
	xmlns:content="http://purl.org/rss/1.0/modules/content/">
<channel>
	<title>Discussion on: Data validation using IDataErrorInfo</title>
	<link>http://itknowledgeexchange.techtarget.com/wpf/data-validation-using-idataerrorinfo/</link>
	<description></description>
	<pubDate>Sat, 17 May 2008 02:01:04 +0000</pubDate>
	<generator>http://wordpress.org/?v=wordpress-mu-1.2.1</generator>

	<item>
		<title>By: MarkWPF2</title>
		<link>http://itknowledgeexchange.techtarget.com/wpf/data-validation-using-idataerrorinfo/#comment-14</link>
		<author>MarkWPF2</author>
		<pubDate>Tue, 22 Apr 2008 15:53:18 +0000</pubDate>
		<guid>http://itknowledgeexchange.techtarget.com/wpf/data-validation-using-idataerrorinfo/#comment-14</guid>
		<description>If you've implemented IDataErrorInfo on both the parent and child classes, then you can attach to collection changed event.
In the handler for the event, raise the property changed event for the Error property (ProperyChanged in INotifyPropertyChanged).
Then put processing for the collection property in this[string]</description>
		<content:encoded><![CDATA[<p>If you&#8217;ve implemented IDataErrorInfo on both the parent and child classes, then you can attach to collection changed event.<br />
In the handler for the event, raise the property changed event for the Error property (ProperyChanged in INotifyPropertyChanged).<br />
Then put processing for the collection property in this[string]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Rdwheeler</title>
		<link>http://itknowledgeexchange.techtarget.com/wpf/data-validation-using-idataerrorinfo/#comment-13</link>
		<author>Rdwheeler</author>
		<pubDate>Mon, 21 Apr 2008 19:54:04 +0000</pubDate>
		<guid>http://itknowledgeexchange.techtarget.com/wpf/data-validation-using-idataerrorinfo/#comment-13</guid>
		<description>Any idea how to handle validation on a property that is a collection? For instance I'd like to make sure the a collection contains at least one item: person.Friends &#62; 0</description>
		<content:encoded><![CDATA[<p>Any idea how to handle validation on a property that is a collection? For instance I&#8217;d like to make sure the a collection contains at least one item: person.Friends &gt; 0</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Siniypin</title>
		<link>http://itknowledgeexchange.techtarget.com/wpf/data-validation-using-idataerrorinfo/#comment-12</link>
		<author>Siniypin</author>
		<pubDate>Wed, 26 Mar 2008 15:03:42 +0000</pubDate>
		<guid>http://itknowledgeexchange.techtarget.com/wpf/data-validation-using-idataerrorinfo/#comment-12</guid>
		<description>WPF binding engine can be merged with other validation facilities, for example it can be Enterprise Library Validation Application Block via the IDataError interface.

One can substitute validation ruleset into the indexer of IDataError 

public string this[string columnName]
{
get;
}

and in getter object asks the VAB to create validator and validate itself via this validator. And after that return some possible validation results.

I used the similiar approach in WPF 3.0, but instead of DataErrorValidationRule I've inserted the Validate method in my domain objects which encapsulated all of the VAB code and called this Validate(ruleSet) method from the wpf command execution method.
You can more accurate description of approach in my blogs:
http://robbbloggg.blogspot.com/
http://bobbbloggg.blogspot.com/

I think that this approach is much easier then these two:
http://www.clariusconsulting.net/blogs/kzu/archive/2007/09/26/AutomaticinputvalidationinWPFwithdatabindingandEnterpriseLibraryValidationApplicationpBlock.aspx
http://www.bennedik.de/2007/05/update-of-wpf-integration-for.html

the only disadvantage is that your business objects will be coupled to VAB or any other validation library.</description>
		<content:encoded><![CDATA[<p>WPF binding engine can be merged with other validation facilities, for example it can be Enterprise Library Validation Application Block via the IDataError interface.</p>
<p>One can substitute validation ruleset into the indexer of IDataError </p>
<p>public string this[string columnName]<br />
{<br />
get;<br />
}</p>
<p>and in getter object asks the VAB to create validator and validate itself via this validator. And after that return some possible validation results.</p>
<p>I used the similiar approach in WPF 3.0, but instead of DataErrorValidationRule I&#8217;ve inserted the Validate method in my domain objects which encapsulated all of the VAB code and called this Validate(ruleSet) method from the wpf command execution method.<br />
You can more accurate description of approach in my blogs:<br />
&lt;a href="http://robbbloggg.blogspot.com/" rel="nofollow"&gt;http://robbbloggg.blogspot.com/&lt;/a&gt;<br />
&lt;a href="http://bobbbloggg.blogspot.com/" rel="nofollow"&gt;http://bobbbloggg.blogspot.com/&lt;/a&gt;</p>
<p>I think that this approach is much easier then these two:<br />
&lt;a href="http://www.clariusconsulting.net/blogs/kzu/archive/2007/09/26/AutomaticinputvalidationinWPFwithdatabindingandEnterpriseLibraryValidationApplicationpBlock.aspx" rel="nofollow"&gt;http://www.clariusconsulting.net/blogs/kzu/archive/2007/09/26/AutomaticinputvalidationinWPFwithdatabindingandEnterpriseLibraryValidationApplicationpBlock.aspx&lt;/a&gt;<br />
&lt;a href="http://www.bennedik.de/2007/05/update-of-wpf-integration-for.html" rel="nofollow"&gt;http://www.bennedik.de/2007/05/update-of-wpf-integration-for.html&lt;/a&gt;</p>
<p>the only disadvantage is that your business objects will be coupled to VAB or any other validation library.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
