Assembly: PresentationFramework (in PresentationFramework.dll)
When you set the BindingGroup that has the same ValidationRule objects as the , but the properties that describe the data in the bindings, such as Items and BindingExpressions, are specific to the data for each item in the ItemsControl. You must access the item container's BindingGroup to perform operations such as validate the data and check for errors on an item.property, each item container gets a
The following example is part of an application that prompts the user to enter multiple customers and assign a sales representative to each customer, and then checks that the sales representative and the customer belong to the same region. The example sets the ItemsControl so the ValidationRule, AreasMatch, will validate each item. The example also creates a Label that displays validation errors. Notice that the Content of the Label is bound to a ValidationError that it gets from the Validation.ValidationAdornerSiteFor property. The value of Validation.ValidationAdornerSiteFor is the item container that has the error.of the
The following example gets the item container and calls UpdateSources on the container's BindingGroup to validate the data. You must validate the data by calling a method on the item container's BindingGroup, not on the of the ItemsControl.
Available since 3.0