private void ItemSwipeProgressInTouch(object sender, SwipeProgressEventArgs args)
        {
            Debug.WriteLine("Direction: " + args.SwipeDirection + " , Length: " + args.Cumulative + " , rate: " + args.CurrentRate);

            if (args.SwipeDirection == SwipeDirection.None)
                return;

            var panel = Getpanel(sender, args.SwipeDirection);
            SwipeMovePanel(panel, args);
        }
Beispiel #2
0
        public static void SwipeMovePanel(StackPanel panel, LLM.SwipeProgressEventArgs args)
        {
            var cumlative = Math.Abs(args.Cumulative);

            if (panel == null && cumlative - panel.ActualWidth >= 0)
            {
                return;
            }

            if (args.CurrentRate < 0.3 && cumlative - panel.ActualWidth > 0)
            {
                (panel.RenderTransform as TranslateTransform).X += args.Delta / 2;
            }
            else if (args.CurrentRate >= 0.3 && args.CurrentRate < 0.4 && cumlative - panel.ActualWidth > 0)
            {
                (panel.RenderTransform as TranslateTransform).X += args.Delta * 2;
            }
            else
            {
                (panel.RenderTransform as TranslateTransform).X = args.SwipeDirection == LLM.SwipeDirection.Left ? cumlative - panel.ActualWidth : panel.ActualHeight - cumlative;
            }
        }
Beispiel #3
0
 private void Item_SwipeProgressInTouch(object sender, SwipeProgressEventArgs args)
 {
     ItemSwipeProgressInTouch?.Invoke(sender, args);
 }
        void SwipeMovePanel(StackPanel panel, SwipeProgressEventArgs args)
        {
            var cumlative = Math.Abs(args.Cumulative);

            if (panel == null && cumlative - panel.ActualWidth >= 0)
                return;

            if (args.CurrentRate < 0.3 && cumlative - panel.ActualWidth > 0)
            {
                (panel.RenderTransform as TranslateTransform).X += args.Delta / 2;
            }
            else if (args.CurrentRate >= 0.3 && args.CurrentRate < 0.4 && cumlative - panel.ActualWidth > 0)
            {
                (panel.RenderTransform as TranslateTransform).X += args.Delta * 2;
            }
            else
            {
                (panel.RenderTransform as TranslateTransform).X = args.SwipeDirection == SwipeDirection.Left ? cumlative - panel.ActualWidth : panel.ActualHeight - cumlative;
            }
        }