private async Task TranslateCardFrame() { if (CardFrame.TranslationY < 100) { await CardFrame.TranslateTo(0, 0, 250); } else { await CardFrame.TranslateTo(0, 350, 250); } }
private async void PanUpdated(object sender, PanUpdatedEventArgs e) { switch (e.StatusType) { case GestureStatus.Running: await CardFrame.TranslateTo(0, e.TotalY, 100); break; case GestureStatus.Completed: await TranslateCardFrame(); break; case GestureStatus.Canceled: await TranslateCardFrame(); break; } }
private async void HandleTouchEnd() { if (CardFrame.TranslationX > animationSlideRange) { OnSwipeRight(); return; } else if (CardFrame.TranslationX < -(animationSlideRange)) { OnSwipeLeft(); return; } await CardFrame.TranslateTo(0, 0, animLength, Easing.SpringOut); BackGrid.Opacity = 0; cardDistance = (float)X; sliding = false; }