Represents the method that handles exceptions that are thrown during the update of the binding source value. This must be used with the ExceptionValidationRule.
Assembly: PresentationFramework (in PresentationFramework.dll)
public delegate object UpdateSourceExceptionFilterCallback( object bindExpression, Exception exception )
The object with the exception.
The exception encountered.
Return ValueType: System.Object
An object that is typically one of the following:
A ValidationError object
If you have associated the ExceptionValidationRule with your Binding object you have the option to use the UpdateSourceExceptionFilter property to set this callback to provide custom logic for handling the exceptions. This callback is invoked whenever any exception is encountered when the binding engine updates the value.GTMT
If an UpdateSourceExceptionFilter is not specified on the Binding, the binding engine creates a ValidationError with the exception and adds it to the Validation.Errors collection of the bound element.
Legacy Code Example
The Text property of the following TextBox is data-bound to a source property Age3 that is of type int. The ExceptionValidationRule checks for exceptions that are thrown during the update of the source property (such as when the user enters a value that cannot be converted to an integer).Code snippet is not found. Confirm that the code snippet name 'BindValidation' is correct.
You have the option to provide custom logic to handle those exceptions. The following example shows how to use the UpdateSourceExceptionFilter property to set an :Code snippet is not found. Confirm that the code snippet name 'BindValidation' is correct.
The following is an example implementation of an:Code snippet is not found. Confirm that the code snippet name 'BindValidation' is correct.
For the complete sample, see Binding Validation Sample.
Available since 3.0