示例#1
0
        public TouchRecognizer(Element element, UIView view, Impromptu.Effects.TouchHandling.TouchEffect touchEffect)
        {
            _element     = element;
            _view        = view;
            _touchEffect = touchEffect;

            ViewDictionary.Add(view, this);
        }
示例#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 TouchEffect class in the PCL
            Impromptu.Effects.TouchHandling.TouchEffect touchEffect =
                (Impromptu.Effects.TouchHandling.TouchEffect)Element.Effects.FirstOrDefault(e => e is Impromptu.Effects.TouchHandling.TouchEffect);

            if (touchEffect != null && _view != null)
            {
                ViewDictionary.Add(_view, this);

                _formsElement = Element;

                _pclTouchEffect = touchEffect;

                // Save fromPixels function
                _fromPixels = _view.Context.FromPixels;

                // Set event handler on View
                _view.Touch += OnTouch;
            }
        }