void OnUp(DownUpGestureRecognizer gr, UITouch[] touchesEnded) { if (!_element.IsVisible) { return; } bool handled = false; DownUpEventArgs args = new iOSDownUpEventArgs(gr, touchesEnded); foreach (var listener in _listeners) { if (listener.HandlesUp) { args.Listener = listener; listener.OnUp(args); handled = handled || args.Handled; if (handled) { break; } } } touchCount--; }
void OnDown(DownUpGestureRecognizer gr, UITouch[] touchesBegan) { _panning = false; if (!_element.IsVisible) { return; } bool handled = false; touchCount++; DownUpEventArgs args = new iOSDownUpEventArgs(gr, touchesBegan); foreach (var listener in _listeners) { if (listener.HandlesDown) { args.Listener = listener; listener.OnDown(args); handled = handled || args.Handled; if (handled) { break; } } } _downGestureArgs = args; }
void OnDown(DownUpGestureRecognizer gr, UITouch[] touchesBegan) { _panning = false; if (!_element.IsVisible) { return; } /* * var control = (UIView)_view.GetPropertyValue ("Control"); * if (control is UIButton) * ((UIButton)control).SendActionForControlEvents (UIControlEvent.TouchDown); */ bool handled = false; if (touchCount == 0) { //System.Diagnostics.Debug.WriteLine("onDown set _viewLocationAtOnDown"); _viewLocationAtOnDown = ViewLocationInWindow(gr.View); } touchCount++; //System.Diagnostics.Debug.WriteLine("\tNativeGestureHandler.onDown _touchCount=["+_touchCount+"] _viewLocation=["+_viewLocationAtOnDown+"]"); foreach (var listener in _listeners) { //if (handled) // break; if (listener.HandlesDown) { DownUpEventArgs args = new iOSDownUpEventArgs(gr, touchesBegan, _viewLocationAtOnDown) { Listener = listener }; listener.OnDown(args); handled = handled || args.Handled; if (handled) { break; } } } //gr.CancelsTouchesInView = handled; //System.Diagnostics.Debug.WriteLine("\thandled=["+handled+"]"); }
void OnUp(DownUpGestureRecognizer gr, UITouch[] touchesEnded) { if (!_element.IsVisible) { return; } /* * var control = (UIView)_view.GetPropertyValue ("Control"); * if (control is UIButton) * ((UIButton)control).SendActionForControlEvents (UIControlEvent.TouchUpInside); */ bool handled = false; foreach (var listener in _listeners) { //if (handled) // break; if (listener.HandlesUp) { DownUpEventArgs args = new iOSDownUpEventArgs(gr, touchesEnded, _viewLocationAtOnDown) { Listener = listener }; listener.OnUp(args); handled = handled || args.Handled; if (handled) { break; } } } touchCount--; //System.Diagnostics.Debug.WriteLine("onUp touchCount-- = ["+_touchCount+"] touchesEnded.Length=["+touchesEnded.Length+"]"); //System.Diagnostics.Debug.WriteLine("\tNativeGestureHandler.onUp _touchCount=[" + _touchCount + "] _viewLocation=[" + _viewLocationAtOnDown + "]"); //gr.CancelsTouchesInView = handled; //System.Diagnostics.Debug.WriteLine("\thandled=[" + handled + "]"); }