Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using Foundation;
- using UIKit;
- using Xamarin.Forms;
- using APPChamada.Class;
- using APPChamada.iOS.Class;
- using Xamarin.Forms.Platform.iOS;
- using System.ComponentModel;
- [assembly: ExportRenderer(typeof(BoxViewWithLongPressGesture), typeof(LongPressGestureRecognizerBoxViewRenderer))]
- namespace APPChamada.iOS.Class
- {
- class LongPressGestureRecognizerBoxViewRenderer : BoxRenderer
- {
- public double TotalX { set; get; }
- public double TotalY { set; get; }
- public GestureStatusCustom StatusType { get; set; }
- public event EventHandler PanUpdated;
- PanGestureRecognizerCustomiOS GesturePan = new PanGestureRecognizerCustomiOS();
- public static void Init()
- {
- }
- private void InvokeHandlerPanUpDate()
- {
- PanUpdated?.Invoke((object)this, EventArgs.Empty);
- }
- public LongPressGestureRecognizerBoxViewRenderer()
- {
- this.UserInteractionEnabled = true;
- this.AddGestureRecognizer(new UILongPressGestureRecognizer((longPress) => {
- if (longPress.State == UIGestureRecognizerState.Began)
- {
- Console.WriteLine("Deseja excluir o registro?");
- }
- }));
- this.AddGestureRecognizer(GesturePan);
- GesturePan.PanUpdated += (y, n) =>
- {
- Refresh();
- };
- }
- private void Refresh()
- {
- TotalX = GesturePan.TotalX;
- TotalY = GesturePan.TotalY;
- StatusType = GesturePan.StatusType;
- InvokeHandlerPanUpDate();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement