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; } }
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); } }
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; } }