Ejemplo n.º 1
0
 public static bool Fire(Windows.UI.Xaml.FrameworkElement element, Windows.UI.Xaml.Input.RightTappedRoutedEventArgs args, FormsGestures.Listener listener)
 {
     var f9pArgs = new UwpRightClickEventArgs(element, args, listener);
     listener.OnRightClicked(f9pArgs);
     args.Handled = f9pArgs.Handled;
     return args.Handled;
 }
Ejemplo n.º 2
0
        /*
         * private void _UwpElement_PointerEntered(object sender, PointerRoutedEventArgs e)
         * {
         *  PointerRoutedDebugMessage(e, "POINTER ENTERED");
         * }
         *
         * private void _UwpElement_PointerExited(object sender, PointerRoutedEventArgs e)
         * {
         *  PointerRoutedDebugMessage(e, "POINTER EXITED");
         * }
         *
         * private void _UwpElement_PointerMoved(object sender, PointerRoutedEventArgs e)
         * {
         *  PointerRoutedDebugMessage(e, "POINTER MOVED");
         *
         * }
         *
         * private void _UwpElement_PointerPressed(object sender, PointerRoutedEventArgs e)
         * {
         *  PointerRoutedDebugMessage(e, "POINTER PRESSED");
         * }
         *
         * private void _UwpElement_PointerReleased(object sender, PointerRoutedEventArgs e)
         * {
         *  PointerRoutedDebugMessage(e,"POINTER RELEASED");
         * }
         *
         * private void _UwpElement_PointerWheelChanged(object sender, PointerRoutedEventArgs e)
         * {
         *  PointerRoutedDebugMessage(e, "POINTER WHEEL CHANGED");
         * }
         *
         * private void _UwpElement_RightTapped(object sender, RightTappedRoutedEventArgs e)
         * {
         *  var currentPoint = e.GetPosition(null);
         *  DebugMethodName(2);
         *  DebugMessage("CurrentPoint: pos=[" + currentPoint.X + "," + currentPoint.Y + "] Handled=["+e.Handled+"] type=["+e.PointerDeviceType+"]");
         * }
         *
         * private void _UwpElement_Tapped(object sender, TappedRoutedEventArgs e)
         * {
         *
         *  var currentPoint = e.GetPosition(null);
         *  DebugMethodName(2);
         *  DebugMessage("CurrentPoint: pos=[" + currentPoint.X + "," + currentPoint.Y + "] Handled=[" + e.Handled + "] type=[" + e.PointerDeviceType + "]");
         *
         *  long elapsed = 0;
         *  if (_pressTimer != null)
         *  {
         *      elapsed = _pressTimer.ElapsedMilliseconds;
         *      _pressTimer?.Stop();
         *      _pressTimer = null;
         *  }
         *
         *  if (!_xfElement.IsVisible || FrameworkElement == null)
         *      return;
         *
         *  foreach (var listener in _listeners)
         *  {
         *      if (listener.HandlesTapped)
         *      {
         *          var args = new UwpTapEventArgs(FrameworkElement, e, _numberOfTaps);
         *          args.Listener = listener;
         *          listener?.OnTapped(args);
         *          e.Handled = args.Handled;
         *      }
         *      if (_longPressing && listener.HandlesLongPressed)
         *      {
         *          var args = new UwpLongPressEventArgs(FrameworkElement, e, elapsed);
         *          args.Listener = listener;
         *          listener?.OnLongPressed(args);
         *          e.Handled = args.Handled;
         *      }
         *      if (e.Handled)
         *          break;
         *  }
         *
         *  _longPressing = false;
         *
         * }
         */

        private void OnElementRightTapped(object sender, RightTappedRoutedEventArgs e)
        {
            if (!_xfElement.IsVisible || FrameworkElement == null)
            {
                return;
            }
            DebugMethodName(2);

            var currentPoint = e.GetPosition(null);

            DebugMethodName(2);
            DebugMessage("CurrentPoint: pos=[" + currentPoint.X + "," + currentPoint.Y + "] Handled=[" + e.Handled + "] type=[" + e.PointerDeviceType + "]");

            foreach (var listener in _listeners)
            {
                if (listener.HandlesRightClicked && UwpRightClickEventArgs.Fire(FrameworkElement, e, listener))
                {
                    return;
                }
            }
        }