Пример #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
            Onek.TouchTracking.TouchEffect touchEffect =
                (Onek.TouchTracking.TouchEffect)Element.Effects.
                FirstOrDefault(e => e is Onek.TouchTracking.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;
            }
        }
Пример #2
0
        public TouchRecognizer(Element element, UIView view, Onek.TouchTracking.TouchEffect touchEffect)
        {
            this.element     = element;
            this.view        = view;
            this.touchEffect = touchEffect;

            viewDictionary.Add(view, this);
        }