Validation.ValidationAdornerSite Attached Property
Gets or sets the element that appears to indicate that a validation error occurred on the bound element where this property is set.
Assembly: PresentationFramework (in PresentationFramework.dll)
The Validation.ValidationAdornerSiteFor attached properties reference each other, and you can set either one. For example, suppose that a Label displays validation errors that occur on a data-bound TextBox. You can do one of the following to establish that relationship:and
When you set one of the properties, the other property is set to the element on which you set the attached property; regardless of which of the previous options you choose, the TextBox is the Label and the ValidationAdornerSiteFor for the Label is the TextBox.for the
The following example uses a Label as the adorner site for the validation errors that occur on items in an ItemsControl. The example sets the for each item container in the ItemContainerStyle to the label. The example uses the Validation.ValidationAdornerSiteFor property to get the item container that has the error and binds the Content of the Label to the first ValidationError that is reported.