EditModeValidationError Event

Occurs when the user attempts to leave the editor with an invalid value.
Public Event EditModeValidationError As EventHandler(Of EditModeValidationErrorEventArgs)
public event EventHandler<EditModeValidationErrorEventArgs> EditModeValidationError
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.

Editor Gets the associated value editor.
ErrorMessage Gets or sets the error message.
Exception Gets any exception associated with the validation error.
ForceExitEditMode Indicates if the edit mode is being exitted forcefully. For example, when the application is being closed.
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.

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.


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