Exemple #1
0
        void OnPanUpdated(object sender, PanUpdatedEventArgs e)
        {
            View Content = (View)sender;

            switch (e.StatusType)
            {
            case GestureStatus.Running:

                try
                {
                    translatedX = e.TotalX;
                    if (translatedX < 0)
                    {
                        mISwipeCallback.onLeftSwipeProcess(translatedX);
                    }
                    else if (translatedX > 0)
                    {
                        mISwipeCallback.onRightSwipeProcess(translatedX);
                    }
                }
                catch (Exception err)
                {
                    App.PrintNote("" + err.Message);
                }
                break;

            case GestureStatus.Completed:
                if (translatedX < (-Content.Width * SwiperStackLayout.Threshold))
                {
                    mISwipeCallback.onLeftSwipe();
                }
                else if (translatedX > (Content.Width * SwiperStackLayout.Threshold))
                {
                    mISwipeCallback.onRightSwipe();
                }
                else
                {
                    mISwipeCallback.onNothingSwiped();
                }

                break;
            }
        }
        void OnPanUpdated(object sender, PanUpdatedEventArgs e)
        {
            View Content = (View)sender;

            switch (e.StatusType)
            {
            case GestureStatus.Running:
                try {
                    translatedX = e.TotalX;
                    translatedY = e.TotalY;
                } catch (Exception err) {
                    System.Diagnostics.Debug.WriteLine("" + err.Message);
                }
                break;

            case GestureStatus.Completed:
                System.Diagnostics.Debug.WriteLine("translatedX : " + translatedX);
                System.Diagnostics.Debug.WriteLine("translatedY : " + translatedY);
                if (translatedX < 0 && Math.Abs(translatedX) > Math.Abs(translatedY))
                {
                    mISwipeCallback.onLeftSwipe(Content);
                }
                else if (translatedX > 0 && translatedX > Math.Abs(translatedY))
                {
                    mISwipeCallback.onRightSwipe(Content);
                }
                else if (translatedY < 0 && Math.Abs(translatedY) > Math.Abs(translatedX))
                {
                    mISwipeCallback.onTopSwipe(Content);
                }
                else if (translatedY > 0 && translatedY > Math.Abs(translatedX))
                {
                    mISwipeCallback.onBottomSwipe(Content);
                }
                else
                {
                    mISwipeCallback.onNothingSwiped(Content);
                }
                break;
            }
        }