Windows Dev Center

The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

ValidationStep Enumeration


Specifies when a ValidationRule runs.

Namespace:   System.Windows.Controls
Assembly:  PresentationFramework (in PresentationFramework.dll)

public enum ValidationStep

Member nameDescription

Runs the ValidationRule after the value has been committed to the source.


Runs the ValidationRule after the value is converted.


Runs the ValidationRule before any conversion occurs.


Runs the ValidationRule after the source is updated.

The following example uses a ValidationRule named ValidateDateAndPrice. The ValidationStep for this rule is set to ConvertedProposedValue so that when it runs, the Validate method has access to values that are of the source property's type.

When the PriceIsAPositiveNumber and FutureDateRule rules run, the values in each Validate method are strings because the default value of ValidationStep is RawProposedValue. Therefore, the rules run before the values are converted to their respective types.

The following example shows the ValidateDateAndPriceValidationRule. In the Validate method, the Price property is of type Double and the OfferExpires property is of type DateTime. The strings have been converted to their respective types by the time the ValidationRule runs.

.NET Framework
Available since 3.0
Return to top
© 2015 Microsoft