-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Closed
Description
Describe the bug
Setting ValidatesOnExceptions=True on a binding causes the ValidationErrorTemplate to jump to the window title in case of exceptions.
Steps to reproduce
- Go to the MahAppsDemo project
- Add ValidatesOnExceptions=True to the enabled TextBox with ValidationError (that binds to IntegerGreater10Property) on the TextExamples.xaml view. here
- Start the demo
- Enter the TextBox and provoke an error by hitting the spacebar (entering a space instead of a number).
Expected behavior
The ValidationErrorTemplate should not follow kriss kross and stop jumping around :-P
Possible Fix
I think CustomValidationPopup.ScrollViewer_ScrollChanged is the culprit. The call to RefreshPosition() should be inside of the if-statement that checks whether scrolling actually happened. After I removed that line the jumping stopped. And since the scrollchanged event is fired even if the scrollposition didn't change, I think RefreshPosition() can be safely moved into that if-statement.
Environment
MahApps.Metro version: v2.0.0
Windows build number: Win10 1607
Rider 2021.1.3
Target Framework: .Net v4.7.2