Validation.ValidationAdornerSiteFor Attached Property
Gets or sets the element for which this element appears to indicate that an error occurred.
Assembly: PresentationFramework (in PresentationFramework.dll)
The Validation.ValidationAdornerSite and 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:
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 Validation.ValidationAdornerSite for the TextBox is the Label and the for the Label is the TextBox.
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 Validation.ValidationAdornerSite for each item container in the ItemContainerStyle to the label. The example uses the property to get the item container that has the error and binds the Content of the Label to the first ValidationError that is reported.