I have an ItemsControl which is validated by an object on the DataContext that implements INotifyDataErrorInfo. The intended effect is for the validation error to show below the control in a TextBlock, rather than the conventional red border and tooltip style.
Upon validation, my TextBlock appears, but it's Text is empty - there's something wrong with my binding to the validation error, but I can't figure out what.
Also, the TextBlock overlaps the control below the ItemsControl it rather than making extra space for itself. How can I solve these issues?
<ItemsControl ...>
<Validation.ErrorTemplate>
<ControlTemplate>
<StackPanel>
<AdornedElementPlaceholder />
<TextBlock Text="{Binding RelativeSource={RelativeSource Self},
Path=(Validation.Errors).CurrentItem.ErrorContent}" />
</StackPanel>
</ControlTemplate>
</Validation.ErrorTemplate>
</ItemsControl>