Пример #1
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 .NET Standard library
            Views.Brainstorming.SpecialContent.Sketching.TouchEffect.TouchEffect touchEffect =
                (Views.Brainstorming.SpecialContent.Sketching.TouchEffect.TouchEffect)Element.Effects.
                FirstOrDefault(e => e is Views.Brainstorming.SpecialContent.Sketching.TouchEffect.TouchEffect);

            if (touchEffect != null && view != null)
            {
                viewDictionary.Add(view, this);

                formsElement = Element;

                libTouchEffect = touchEffect;

                // Save fromPixels function
                fromPixels = view.Context.FromPixels;

                // Set event handler on View
                view.Touch += OnTouch;
            }
        }
Пример #2
0
        public TouchRecognizer(Element element, UIView view, Views.Brainstorming.SpecialContent.Sketching.TouchEffect.TouchEffect touchEffect)
        {
            this.element     = element;
            this.view        = view;
            this.touchEffect = touchEffect;

            viewDictionary.Add(view, this);
        }
Пример #3
0
        protected override void OnAttached()
        {
            // Get the iOS UIView corresponding to the Element that the effect is attached to
            view = Control ?? Container;

            // Uncomment this line if the UIView does not have touch enabled by default
            //view.UserInteractionEnabled = true;

            // Get access to the TouchEffect class in the .NET Standard library

            Views.Brainstorming.SpecialContent.Sketching.TouchEffect.TouchEffect effect =
                (Views.Brainstorming.SpecialContent.Sketching.TouchEffect.TouchEffect)Element.Effects
                .FirstOrDefault(e => e is Views.Brainstorming.SpecialContent.Sketching.TouchEffect.TouchEffect);

            if (effect != null && view != null)
            {
                // Create a TouchRecognizer for this UIView
                touchRecognizer = new TouchRecognizer(Element, view, effect);
                view.AddGestureRecognizer(touchRecognizer);
            }
        }