示例#1
0
        protected override void OnAttached()
        {
            // Get the Android View corresponding to the Element that the effect is attached to
            _view = Control == null ? Container : Control;

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

            if (_view != null)
            {
                _displayDensity = _view.Context.Resources.DisplayMetrics.Density;

                // Set event handler on View
                _view.Touch += OnTouch;
            }
        }
示例#2
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
            _touchEffect = (XamKit.TouchEffect)Element.Effects.FirstOrDefault(e => e is XamKit.TouchEffect);

            if (_view != null)
            {
                _pressedGestureRecognizer           = new UIPressedGestureRecognizer();
                _pressedGestureRecognizer.Pressed  += OnPressed;
                _pressedGestureRecognizer.Released += OnReleased;
                _pressedGestureRecognizer.Canceled += OnCanceled;
                _pressedGestureRecognizer.Moved    += OnMoved;
                _view.AddGestureRecognizer(_pressedGestureRecognizer);
            }
        }
示例#3
0
        protected override void OnAttached()
        {
            // Get the Android View corresponding to the Element that the effect is attached to
            _view = Control == null ? Container : Control;

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

            if (_view != null)
            {
                _view.PointerPressed  += OnPressed;
                _view.PointerReleased += OnReleased;
                _view.PointerCanceled += OnCanceled;
                _view.PointerExited   += OnPointerExited;
                _view.PointerEntered  += OnPointerEntered;
                _view.PointerMoved    += OnPointerMoved;
            }
        }