public ColorPickerTouchActionEventArgs(long id, ColorPickerTouchActionType type, Point location, bool isInContact) { Id = id; Type = type; Location = location; IsInContact = isInContact; }
void CommonHandler(object sender, ColorPickerTouchActionType touchActionType, PointerRoutedEventArgs args) { PointerPoint pointerPoint = args.GetCurrentPoint(sender as UIElement); Windows.Foundation.Point windowsPoint = pointerPoint.Position; onTouchAction(Element, new ColorPickerTouchActionEventArgs(args.Pointer.PointerId, touchActionType, new Point(windowsPoint.X, windowsPoint.Y), args.Pointer.IsInContact)); }
void FireEvent(ColorPickerTouchRecognizeriOS recognizer, long id, ColorPickerTouchActionType actionType, UITouch touch, bool isInContact) { // Convert touch location to Xamarin.Forms Point value CGPoint cgPoint = touch.LocationInView(recognizer.View); Point xfPoint = new Point(cgPoint.X, cgPoint.Y); // Get the method to call for firing events Action <Element, ColorPickerTouchActionEventArgs> onTouchAction = recognizer.touchEffect.OnTouchAction; // Call that method onTouchAction(recognizer.element, new ColorPickerTouchActionEventArgs(id, actionType, xfPoint, isInContact)); }
void FireEvent(ColorPickerTouchEffectDroid touchEffect, int id, ColorPickerTouchActionType actionType, Point pointerLocation, bool isInContact) { // Get the method to call for firing events Action <Element, ColorPickerTouchActionEventArgs> onTouchAction = touchEffect.libTouchEffect.OnTouchAction; // Get the location of the pointer within the view touchEffect.view.GetLocationOnScreen(twoIntArray); double x = pointerLocation.X - twoIntArray[0]; double y = pointerLocation.Y - twoIntArray[1]; Point point = new Point(fromPixels(x), fromPixels(y)); // Call the method onTouchAction(touchEffect.formsElement, new ColorPickerTouchActionEventArgs(id, actionType, point, isInContact)); }