Esempio n. 1
0
        public GestureManager(IVisualElementRenderer renderer)
        {
            _renderer = renderer;
            _renderer.ElementChanged += OnElementChanged;

            _tapGestureHandler   = new TapGestureHandler(() => View);
            _panGestureHandler   = new PanGestureHandler(() => View, Control.Context.FromPixels);
            _pinchGestureHandler = new PinchGestureHandler(() => View);
            _gestureDetector     =
                new Lazy <GestureDetector>(
                    () =>
                    new GestureDetector(
                        _gestureListener =
                            new InnerGestureListener(_tapGestureHandler.OnTap, _tapGestureHandler.TapGestureRecognizers,
                                                     _panGestureHandler.OnPan, _panGestureHandler.OnPanStarted, _panGestureHandler.OnPanComplete)));

            _scaleDetector =
                new Lazy <ScaleGestureDetector>(
                    () =>
                    new ScaleGestureDetector(Control.Context,
                                             new InnerScaleListener(_pinchGestureHandler.OnPinch, _pinchGestureHandler.OnPinchStarted,
                                                                    _pinchGestureHandler.OnPinchEnded), Control.Handler));

            Control.SetOnClickListener(this);
            Control.SetOnTouchListener(this);
        }
Esempio n. 2
0
        public FrameRenderer() : base(Forms.Context)
        {
            _tapGestureHandler   = new TapGestureHandler(() => Element);
            _panGestureHandler   = new PanGestureHandler(() => Element, Context.FromPixels);
            _pinchGestureHandler = new PinchGestureHandler(() => Element);

            _gestureDetector =
                new Lazy <GestureDetector>(
                    () =>
                    new GestureDetector(
                        _gestureListener =
                            new InnerGestureListener(_tapGestureHandler.OnTap, _tapGestureHandler.TapGestureRecognizers, _panGestureHandler.OnPan, _panGestureHandler.OnPanStarted, _panGestureHandler.OnPanComplete)));

            _scaleDetector =
                new Lazy <ScaleGestureDetector>(
                    () => new ScaleGestureDetector(Context, new InnerScaleListener(_pinchGestureHandler.OnPinch, _pinchGestureHandler.OnPinchStarted, _pinchGestureHandler.OnPinchEnded), Handler));
        }
Esempio n. 3
0
		public FrameRenderer() : base(Forms.Context)
		{
			_tapGestureHandler = new TapGestureHandler(() => Element);
			_panGestureHandler = new PanGestureHandler(() => Element, Context.FromPixels);
			_pinchGestureHandler = new PinchGestureHandler(() => Element);

			_gestureDetector =
				new Lazy<GestureDetector>(
					() =>
					new GestureDetector(
						_gestureListener =
						new InnerGestureListener(_tapGestureHandler.OnTap, _tapGestureHandler.TapGestureRecognizers, _panGestureHandler.OnPan, _panGestureHandler.OnPanStarted, _panGestureHandler.OnPanComplete)));

			_scaleDetector =
				new Lazy<ScaleGestureDetector>(
					() => new ScaleGestureDetector(Context, new InnerScaleListener(_pinchGestureHandler.OnPinch, _pinchGestureHandler.OnPinchStarted, _pinchGestureHandler.OnPinchEnded), Handler));
		}