diff --git a/src/Shared/HandyControl_Shared/Controls/Other/ScrollViewer.cs b/src/Shared/HandyControl_Shared/Controls/Other/ScrollViewer.cs index ab835a59..eea2bd25 100644 --- a/src/Shared/HandyControl_Shared/Controls/Other/ScrollViewer.cs +++ b/src/Shared/HandyControl_Shared/Controls/Other/ScrollViewer.cs @@ -76,7 +76,7 @@ namespace HandyControl.Controls CurrentVerticalOffset = VerticalOffset; } _totalVerticalOffset = Math.Min(Math.Max(0, _totalVerticalOffset - e.Delta), ScrollableHeight); - ScrollToVerticalOffsetInternal(_totalVerticalOffset); + ScrollToVerticalOffsetWithAnimation(_totalVerticalOffset); } else { @@ -86,7 +86,7 @@ namespace HandyControl.Controls CurrentHorizontalOffset = HorizontalOffset; } _totalHorizontalOffset = Math.Min(Math.Max(0, _totalHorizontalOffset - e.Delta), ScrollableWidth); - ScrollToHorizontalOffsetInternal(_totalHorizontalOffset); + ScrollToHorizontalOffsetWithAnimation(_totalHorizontalOffset); } } @@ -97,10 +97,10 @@ namespace HandyControl.Controls _totalVerticalOffset = VerticalOffset; CurrentVerticalOffset = VerticalOffset; } - ScrollToVerticalOffsetInternal(0, milliseconds); + ScrollToVerticalOffsetWithAnimation(0, milliseconds); } - internal void ScrollToVerticalOffsetInternal(double offset, double milliseconds = 500) + public void ScrollToVerticalOffsetWithAnimation(double offset, double milliseconds = 500) { var animation = AnimationHelper.CreateAnimation(offset, milliseconds); animation.EasingFunction = new CubicEase @@ -118,7 +118,7 @@ namespace HandyControl.Controls BeginAnimation(CurrentVerticalOffsetProperty, animation, HandoffBehavior.Compose); } - internal void ScrollToHorizontalOffsetInternal(double offset, double milliseconds = 500) + public void ScrollToHorizontalOffsetWithAnimation(double offset, double milliseconds = 500) { var animation = AnimationHelper.CreateAnimation(offset, milliseconds); animation.EasingFunction = new CubicEase diff --git a/src/Shared/HandyControl_Shared/Controls/TabControl/TabControl.cs b/src/Shared/HandyControl_Shared/Controls/TabControl/TabControl.cs index 5c14721c..c50c092a 100644 --- a/src/Shared/HandyControl_Shared/Controls/TabControl/TabControl.cs +++ b/src/Shared/HandyControl_Shared/Controls/TabControl/TabControl.cs @@ -307,11 +307,11 @@ namespace HandyControl.Controls private void Menu_Closed(object sender, RoutedEventArgs e) => _buttonOverflow.IsChecked = false; private void ButtonScrollRight_Click(object sender, RoutedEventArgs e) => - _scrollViewerOverflow.ScrollToHorizontalOffsetInternal(Math.Min( + _scrollViewerOverflow.ScrollToHorizontalOffsetWithAnimation(Math.Min( _scrollViewerOverflow.CurrentHorizontalOffset + TabItemWidth, _scrollViewerOverflow.ScrollableWidth)); private void ButtonScrollLeft_Click(object sender, RoutedEventArgs e) => - _scrollViewerOverflow.ScrollToHorizontalOffsetInternal(Math.Max( + _scrollViewerOverflow.ScrollToHorizontalOffsetWithAnimation(Math.Max( _scrollViewerOverflow.CurrentHorizontalOffset - TabItemWidth, 0)); private void ButtonOverflow_Click(object sender, RoutedEventArgs e)