So I’m calling the UpdateSource() method on Text property of TextBox in code behind. The ErrorTemplate should come up, but it doesn’t until I move my mouse over the TextBox.
Or maybe it does but doesn’t get repainted? Any ideas how to fix this to update GUI instantly?
EDIT:
It is PropertyChanged. The problem is not with updating source. The problem is that when source updates, it causes validation and the ErrorTemplate should come up, but it doesn’t until I move my mouse over validated TextBox.
EDIT:
Appearently it does update when I move my mouse over some other GUI elements as well (like radio button), which doesn’t have anything to do with validation. This is definitely an issue of repainting or binding validation error check trigger. How can I trigger that in code behind?
You may be able to get Validation_Error to fire.
It may be that since that event is on the TextBox is only fires when the TextBox has focus. You may need to throw a custom event and handle it at the Page/Window.