Version

ValidationError Event

Occurs when the user attempts to leave the editor with an invalid value.
Syntax
'Declaration
 
Public Event ValidationError As EventHandler(Of EditModeValidationErrorEventArgs)
public event EventHandler<EditModeValidationErrorEventArgs> ValidationError
Event Data

The event handler receives an argument of type EditModeValidationErrorEventArgs containing data related to this event. The following EditModeValidationErrorEventArgs properties provide information specific to this event.

PropertyDescription
Editor Gets the associated value editor.
ErrorMessage Gets or sets the error message.
Exception Gets any exception associated with the validation error.
Handled (Inherited from System.Windows.RoutedEventArgs)Gets or sets a value that indicates the present state of the event handling for a routed event as it travels the route.
InvalidValueBehavior Gets or sets the invalid value behavior.
OriginalSource (Inherited from System.Windows.RoutedEventArgs)Gets the original reporting source as determined by pure hit testing, before any possible System.Windows.RoutedEventArgs.Source adjustment by a parent class.
RoutedEvent (Inherited from System.Windows.RoutedEventArgs)Gets or sets the System.Windows.RoutedEventArgs.RoutedEvent associated with this System.Windows.RoutedEventArgs instance.
Source (Inherited from System.Windows.RoutedEventArgs)Gets or sets a reference to the object that raised the event.
Remarks

The editor validates the user input when the user attempts to leave the control after modifying the value of the editor. EditModeValidationError event is raised if the modified value is invalid. The editor considers a value invalid if the entered text can not be parsed into ValueType or it does not satisfy all the constraints specified by the ValueConstraint.

See InvalidValueBehavior and IsValueValid for more information.

Requirements

Target Platforms: Windows 10, Windows 8.1, Windows 8, Windows 7, Windows Server 2012, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also