Click here to Skip to main content
15,886,795 members
Articles / Desktop Programming / WPF

Wpf ErrorProvider - Integrating IDataErrorInfo, WPF, and the Validation Application Block (VAB)

Rate me:
Please Sign up or sign in to vote.
2.14/5 (5 votes)
22 Sep 2008CPOL6 min read 63.9K   2.8K   26  
A WPF validation control integrated with VAB and IDataErrorInfo.
Namespace Common.Entities.Net35
	Public Class BusinessObjectBase(Of T As BusinessObjectBase(Of T))
		Inherits Rahul.Common.Entities.BusinessObjectBase(Of T)

		''<remarks>
		'' Copyright (c) 2008, Rahul Singla (See License.txt)
		'' </remarks>
		Protected Overrides Function validateProperty(ByVal propertyName As String, ByVal ruleSet As String, ByVal validationSpecificationSource As Microsoft.Practices.EnterpriseLibrary.Validation.ValidationSpecificationSource, ByVal types() As System.Type, ByVal index() As Object) As Microsoft.Practices.EnterpriseLibrary.Validation.ValidationResults
			Dim rule As New EnterpriseValidationRule
			rule.SourceTypeName = Me.GetType().AssemblyQualifiedName
			rule.PropertyName = propertyName

			rule.RulesetName = ruleSet
			rule.ValidationSpecificationSource = validationSpecificationSource

			Return (rule.Validate(Me.GetType.GetProperty(propertyName, types).GetValue(Me, index)))
		End Function
	End Class
End Namespace

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
India India
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions