WPF path = (validation. Errors) [0]. Errorcontent reports a binding error

System.Windows.Data Error: 17 : Cannot get ‘Item[]’ value (type ‘ValidationError’) from ‘(Validation.Errors)’ (type ‘ReadOnlyObservableCollection`1′). BindingExpression:Path=AdornedElement.(0)[0].ErrorContent; DataItem=’AdornedElementPlaceholder’ (Name=’customAdorner’); target element is ‘TextBlock'(Name=”); target property is ‘Text’ (type ‘String’) ArgumentOutOfRangeException:’System.ArgumentOutOfRangeException: The specified parameter is out of the range of valid values.

Correct binding method:

Path=(Validation.Errors)/ErrorContent

Read More: