2

Here is what I have so far:

  • a UserControl with a Grid and a TextBox
  • the TextBox.Text property is bound to a custom dependency property

I mapped the validation adorner site to the TextBox

Validation.SetValidationAdornerSite(this, this.InputTextBox);

When binding a text to the custom dependency property of my UserControl the validation errors now should be passed to the inner TextBox.

That works fine. The TextBox gets its red border when an error is fired, but I don't get the error adorner running, so no error messages are displayed.

Using mahapps the errors usally get shown in a red little rectangle next to the e.g. TextBox.

Now I don't know if this is a bug or if I maybe missed something.

Thanks in advance!

panhans
  • 59
  • 3
  • [This helped me](https://stackoverflow.com/questions/59320605/is-it-possible-to-use-reactiveui-bindings-in-wpf-for-validating-user-input-with/61726256#comment109200349_61726256) – Fabian May 11 '20 at 17:36

1 Answers1

0

If you see the red border, it means everything is OK.

The default ErrorTemplate of the TextBox is just that red border.

If you wish for it to disaply more content, you need to edit its ErrorTemplate.

Mishka
  • 508
  • 3
  • 5
  • 1
    That's the case of pure xaml. But I use mahapps on top of it. I will edit this in the topic. – panhans Mar 21 '17 at 07:42
  • I havent used mahapps, but its not like they are reinventing the wheel. Changing Validation.ErrorTemplate should still work. – Mishka Mar 21 '17 at 08:20