Validator.ValidateProperty Method

Microsoft Silverlight will reach end of support after October 2021. Learn more.

Determines whether the specified property value is valid and throws a ValidationException if the property is not valid.

Namespace:  System.ComponentModel.DataAnnotations
Assembly:  System.ComponentModel.DataAnnotations (in System.ComponentModel.DataAnnotations.dll)

Syntax

'Declaration
Public Shared Sub ValidateProperty ( _
    value As Object, _
    validationContext As ValidationContext _
)
public static void ValidateProperty(
    Object value,
    ValidationContext validationContext
)

Parameters

Exceptions

Exception Condition
ArgumentException

MemberName of validationContext is not a valid property.

ValidationException

value is not valid.

Remarks

The ValidateProperty method tests each ValidationAttribute attribute that is associated with the property identified by the validationContext parameter.

Version Information

Silverlight

Supported in: 5, 4, 3

Platforms

For a list of the operating systems and browsers that are supported by Silverlight, see Supported Operating Systems and Browsers.