Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@
<format type="text/markdown"><![CDATA[

## Remarks
The WPF data binding model enables you to associate <xref:System.Windows.Data.Binding.ValidationRules%2A> with a <xref:System.Windows.Data.Binding> or <xref:System.Windows.Data.BindingGroup> object. The <xref:System.Windows.Controls.NotifyDataErrorValidationRule> class is a built-in rule that checks for exceptions that are thrown during the updates of the binding source property. You can provide custom logic to specify how the binding engine handles these exceptions by using a <xref:System.Windows.Data.UpdateSourceExceptionFilterCallback>. For more information, see <xref:System.Windows.Data.Binding.UpdateSourceExceptionFilter%2A>.
The WPF data binding model enables you to associate <xref:System.Windows.Data.Binding.ValidationRules%2A> with a <xref:System.Windows.Data.Binding> object. If your source object implements the <xref:System.ComponentModel.INotifyDataErrorInfo> interface, you can use the built-in rule <xref:System.Windows.Controls.NotifyDataErrorValidationRule> to check for errors raised by the <xref:System.ComponentModel.INotifyDataErrorInfo> implementation.

An alternative syntax to setting the <xref:System.Windows.Controls.NotifyDataErrorValidationRule> explicitly is to set the <xref:System.Windows.Data.Binding.ValidatesOnExceptions%2A> property to `true` on your <xref:System.Windows.Data.Binding>, <xref:System.Windows.Data.MultiBinding>, or <xref:System.Windows.Data.BindingGroup> object. By default, the value of <xref:System.Windows.Data.Binding.ValidatesOnExceptions%2A> is `true`, so you do not need to explicitly use a <xref:System.Windows.Controls.NotifyDataErrorValidationRule>.
An alternative syntax to setting the <xref:System.Windows.Controls.NotifyDataErrorValidationRule> explicitly is to set the <xref:System.Windows.Data.Binding.ValidatesOnNotifyDataErrors%2A> property to `true` on your <xref:System.Windows.Data.Binding>, <xref:System.Windows.Data.MultiBinding>, or <xref:System.Windows.Data.BindingGroup> object. By default, the value of <xref:System.Windows.Data.Binding.ValidatesOnNotifyDataErrors%2A> is `true`, so you do not need to explicitly use a <xref:System.Windows.Controls.NotifyDataErrorValidationRule>.

You can create a custom rule by creating a class that derives from <xref:System.Windows.Controls.ValidationRule>. For more information and a detailed discussion of data validation, see [Data Binding Overview](/dotnet/framework/wpf/data/data-binding-overview).

Expand Down