Skip to content

Commit

Permalink
Merge pull request #4122 from MahApps/fix/4120
Browse files Browse the repository at this point in the history
Fix position of ValidationErrorTemplate together with ValidatesOnExceptions
  • Loading branch information
punker76 authored Jun 10, 2021
2 parents 8079284 + 5bb6841 commit 5c5fd39
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@
Style="{DynamicResource MahApps.Styles.TextBox.Button}" />
<TextBox Margin="{StaticResource ControlMargin}"
mah:TextBoxHelper.Watermark="Number smaller than 10"
Text="{Binding IntegerGreater10Property, ValidatesOnDataErrors=True, UpdateSourceTrigger=PropertyChanged, NotifyOnValidationError=True}" />
Text="{Binding IntegerGreater10Property, ValidatesOnExceptions=True, ValidatesOnDataErrors=True, UpdateSourceTrigger=PropertyChanged, NotifyOnValidationError=True}" />
<TextBox Margin="{StaticResource ControlMargin}"
mah:TextBoxHelper.SelectAllOnFocus="True"
Text="Select all on focus" />
Expand Down
6 changes: 3 additions & 3 deletions src/MahApps.Metro/Controls/CustomValidationPopup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -260,10 +260,10 @@ private void OnTransitionCompleted(object? sender, RoutedEventArgs e)

private void ScrollViewer_ScrollChanged(object? sender, ScrollChangedEventArgs e)
{
this.RefreshPosition();

if (e.VerticalChange > 0 || e.VerticalChange < 0 || e.HorizontalChange > 0 || e.HorizontalChange < 0)
if (e.VerticalChange is > 0 or < 0 || e.HorizontalChange is > 0 or < 0)
{
this.RefreshPosition();

if (IsElementVisible(this.AdornedElement as FrameworkElement, this.scrollViewer))
{
var adornedElement = this.AdornedElement;
Expand Down

0 comments on commit 5c5fd39

Please sign in to comment.