Occurs when Text is set to a value that cannot be interpreted as a date or when the date cannot be selected.
Assembly: PresentationFramework (in PresentationFramework.dll)
After the DatePickerDateValidationErrorEventArgs.ThrowException property to true, one of the following exceptions is raised:event occurs, if you set the
The text entered cannot be parsed to a valid date, and the exception is not suppressed.
The text entered parses to a date that is not selectable.
Legacy Code Example
The following example creates a DatePicker that displays the dates in August 2009 and specifies that each Saturday and Sunday is not selectable.Code snippet is not found. Confirm that the code snippet name 'DatePickerSnippets' is correct.
The DatePicker handles the event, as shown in the following code. If the user enters a date that is not selectable, the example displays a message. If the user enters text that is not a valid date, an exception is thrown.Code snippet is not found. Confirm that the code snippet name 'DatePickerSnippets' is correct.
Available since 4.0
Available since 2.0