Ejemplo n.º 1
0
        public TouchRecognizer(Element element, UIView view, rMultiplatform.Touch touchEffect)
        {
            this.element     = element;
            this.view        = view;
            this.touchEffect = touchEffect;

            viewDictionary.Add(view, this);
        }
Ejemplo n.º 2
0
        protected override void OnAttached()
        {
            // Get the Android View corresponding to the Element that the effect is attached to
            view = Control ?? Container;

            // Get access to the Touch class in the PCL
            effect = (rMultiplatform.Touch)Element.Effects.FirstOrDefault(e => e is rMultiplatform.Touch);

            //If view is valid add touch event
            if (view != null)
            {
                view.Touch += CommonHandler;
            }
        }
Ejemplo n.º 3
0
        protected override void OnAttached()
        {
            // Get the iOS UIView corresponding to the Element that the effect is attached to
            view = Control == null ? Container : Control;

            // Get access to the TouchEffect class in the PCL
            rMultiplatform.Touch effect = (rMultiplatform.Touch)Element.Effects.FirstOrDefault(e => e is rMultiplatform.Touch);

            if (effect != null && view != null)
            {
                // Create a TouchRecognizer for this UIView
                touchRecognizer = new TouchRecognizer(Element, view, effect);
                view.AddGestureRecognizer(touchRecognizer);
            }
        }
Ejemplo n.º 4
0
        //Required by Platform Effect
        protected override void OnAttached()
        {
            // Get the Windows FrameworkElement corresponding to the Element that the effect is attached to
            view = Control ?? Container;

            // Get access to the TouchEffect class in the PCL
            effect = (rMultiplatform.Touch)Element.Effects.FirstOrDefault(e => e is rMultiplatform.Touch);

            if (effect != null && view != null)
            {
                // Set event handlers on FrameworkElement
                view.PointerWheelChanged += ScrollHandler;
                view.PointerEntered      += MoveHandler;
                view.PointerMoved        += MoveHandler;
                view.PointerPressed      += PressedHandler;
                view.PointerReleased     += ReleasedHandler;
                view.PointerExited       += ReleasedHandler;
                view.PointerCanceled     += ReleasedHandler;
            }
        }