Skip to content

Commit a351588

Browse files
small code cleanup
1 parent 3349e2b commit a351588

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

PanCardView/CardsView.cs

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -812,9 +812,11 @@ protected virtual async Task<bool> TryAutoNavigate()
812812
StartAutoNavigation(views, animationId, animationDirection);
813813

814814
//https://github.com/AndreiMisiukevich/CardView/issues/335
815+
Action<double> handlePanChanged = null;
815816
if (Device.RuntimePlatform == Device.UWP)
816817
{
817-
FrontViewProcessor.HandlePanChanged(Enumerable.Repeat(CurrentView, 1), this, CurrentView.TranslationX, realDirection, Enumerable.Empty<View>());
818+
handlePanChanged = value => FrontViewProcessor.HandlePanChanged(Enumerable.Repeat(CurrentView, 1), this, value, realDirection, Enumerable.Empty<View>());
819+
handlePanChanged?.Invoke(Size);
818820
}
819821

820822
await Task.Delay(5);
@@ -824,11 +826,7 @@ protected virtual async Task<bool> TryAutoNavigate()
824826

825827
await (_animationTask = autoNavigationTask);
826828

827-
//https://github.com/AndreiMisiukevich/CardView/issues/335
828-
if (Device.RuntimePlatform == Device.UWP)
829-
{
830-
FrontViewProcessor.HandlePanChanged(Enumerable.Repeat(CurrentView, 1), this, 0, realDirection, Enumerable.Empty<View>());
831-
}
829+
handlePanChanged?.Invoke(0);
832830

833831
EndAutoNavigation(views, animationId, animationDirection);
834832

0 commit comments

Comments
 (0)