Exemple #1
0
 public PanGestureDetector(PanGestureDetector handle) : this(Interop.PanGestureDetector.NewPanGestureDetector(PanGestureDetector.getCPtr(handle)), true)
 {
     if (NDalicPINVOKE.SWIGPendingException.Pending)
     {
         throw NDalicPINVOKE.SWIGPendingException.Retrieve();
     }
 }
Exemple #2
0
        // If two finger long press is done, create a windowView.
        // then, Register a gesture on the windowView to do a resize or move.
        private bool OnTick(object o, Timer.TickEventArgs e)
        {
            windowView = new View()
            {
                WidthResizePolicy  = ResizePolicyType.FillToParent,
                HeightResizePolicy = ResizePolicyType.FillToParent,
                BackgroundColor    = new Color(1, 1, 1, 0.5f),
            };
            windowView.TouchEvent += (s, e) =>
            {
                return(true);
            };
            BorderWindow.Add(windowView);

            winTapGestureDetector = new TapGestureDetector();
            winTapGestureDetector.Attach(windowView);
            winTapGestureDetector.SetMaximumTapsRequired(3);
            winTapGestureDetector.Detected += OnWinTapGestureDetected;

            winPanGestureDetector = new PanGestureDetector();
            winPanGestureDetector.Attach(windowView);
            winPanGestureDetector.Detected += OnWinPanGestureDetected;

            BorderWindow.InterceptTouchEvent -= OnWinInterceptedTouch;
            isWinGestures = true;
            return(false);
        }
Exemple #3
0
        public virtual void OnCreated(View rootView)
        {
            if (rootView == null)
            {
                return;
            }
            // Register to resize and move through pan gestures.
            borderPanGestureDetector = new PanGestureDetector();
            borderPanGestureDetector.Attach(rootView);
            borderPanGestureDetector.Detected += OnPanGestureDetected;

            // Register touch event for effect when border is touched.
            rootView.LeaveRequired = true;
            rootView.TouchEvent   += (s, e) =>
            {
                if (e.Touch.GetState(0) == PointStateType.Started)
                {
                    backgroundColor          = new Color(rootView.BackgroundColor);
                    rootView.BackgroundColor = DefaultClickedBackgroundColor;
                }
                else if (e.Touch.GetState(0) == PointStateType.Finished ||
                         e.Touch.GetState(0) == PointStateType.Leave ||
                         e.Touch.GetState(0) == PointStateType.Interrupted)
                {
                    rootView.BackgroundColor = backgroundColor;
                }
                return(true);
            };

            borderPinchGestureDetector = new PinchGestureDetector();
            borderPinchGestureDetector.Attach(rootView);
            borderPinchGestureDetector.Detected += OnPinchGestureDetected;

            AddInterceptGesture();
        }
 public PanGestureDetector(PanGestureDetector handle) : this(NDalicPINVOKE.new_PanGestureDetector__SWIG_1(PanGestureDetector.getCPtr(handle)), true)
 {
     if (NDalicPINVOKE.SWIGPendingException.Pending)
     {
         throw NDalicPINVOKE.SWIGPendingException.Retrieve();
     }
 }
Exemple #5
0
        internal PanGestureDetector Assign(PanGestureDetector rhs)
        {
            PanGestureDetector ret = new PanGestureDetector(Interop.PanGestureDetector.Assign(SwigCPtr, PanGestureDetector.getCPtr(rhs)), false);

            if (NDalicPINVOKE.SWIGPendingException.Pending)
            {
                throw NDalicPINVOKE.SWIGPendingException.Retrieve();
            }
            return(ret);
        }
Exemple #6
0
        internal new static PanGestureDetector DownCast(BaseHandle handle)
        {
            PanGestureDetector ret = Registry.GetManagedBaseHandleFromNativePtr(handle) as PanGestureDetector;

            if (NDalicPINVOKE.SWIGPendingException.Pending)
            {
                throw NDalicPINVOKE.SWIGPendingException.Retrieve();
            }
            return(ret);
        }
Exemple #7
0
        internal static PanGestureDetector GetPanGestureDetectorFromPtr(global::System.IntPtr cPtr)
        {
            PanGestureDetector ret = new PanGestureDetector(cPtr, false);

            if (NDalicPINVOKE.SWIGPendingException.Pending)
            {
                throw NDalicPINVOKE.SWIGPendingException.Retrieve();
            }
            return(ret);
        }
Exemple #8
0
        public virtual void OnCreated(View borderView)
        {
            if (borderView == null)
            {
                return;
            }
            this.borderView = borderView;
            // Register to resize and move through pan gestures.
            borderPanGestureDetector = new PanGestureDetector();
            borderPanGestureDetector.Attach(borderView);
            borderPanGestureDetector.Detected += OnPanGestureDetected;

            // Register touch event for effect when border is touched.
            borderView.LeaveRequired = true;
            borderView.TouchEvent   += (s, e) =>
            {
                if (e.Touch.GetState(0) == PointStateType.Started)
                {
                    if (BorderWindow.IsMaximized() == false)
                    {
                        BorderWindow.Raise();
                    }
                    backgroundColor            = new Color(borderView.BackgroundColor);
                    borderView.BackgroundColor = DefaultClickedBackgroundColor;
                }
                else if (e.Touch.GetState(0) == PointStateType.Finished ||
                         e.Touch.GetState(0) == PointStateType.Leave ||
                         e.Touch.GetState(0) == PointStateType.Interrupted)
                {
                    borderView.BackgroundColor = backgroundColor;
                }
                return(true);
            };

            borderPinchGestureDetector = new PinchGestureDetector();
            borderPinchGestureDetector.Attach(borderView);
            borderPinchGestureDetector.Detected += OnPinchGestureDetected;

            AddInterceptGesture();

            UpdateIcons();
        }
Exemple #9
0
 internal static global::System.Runtime.InteropServices.HandleRef getCPtr(PanGestureDetector obj)
 {
     return((obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.SwigCPtr);
 }