public override bool ShouldBegin(NSGestureRecognizer gestureRecognizer) { var view = gestureRecognizer.View; var location = gestureRecognizer.LocationInView(view); var subview = view.HitTest(location); return(Equals(subview, view)); }
protected override void OnDetached() { _effect.Control = null; _effect = null; Container?.RemoveGestureRecognizer(_gesture); _gesture?.Dispose(); _gesture = null; }
public PopupPageRenderer() { _tapGestureRecognizer = new NSClickGestureRecognizer(OnBackgroundTap) { Delegate = new OnlyMainViewGestureRecognizerDelegate() }; View.AddGestureRecognizer(_tapGestureRecognizer); View.AutoresizingMask |= NSViewResizingMask.WidthSizable | NSViewResizingMask.HeightSizable; }
protected override void OnAttached() { _effect = Element.GetTouchEff(); _effect.Control = Element as VisualElement; _effect.ForceUpdateState(false); if (Container != null) { _gesture = new TouchNSClickGestureRecognizer(_effect, Container); Container.AddGestureRecognizer(_gesture); } }
protected override void OnDetached() { _mouseTrackingView?.RemoveFromSuperview(); _mouseTrackingView?.Dispose(); _mouseTrackingView = null; _effect.Control = null; _effect = null; if (_gesture != null) { Container?.RemoveGestureRecognizer(_gesture); } _gesture?.Dispose(); _gesture = null; }
protected override void OnAttached() { _effect = Element.PickTouchEff(); if (_effect?.IsDisabled ?? true) { return; } _effect.Control = Element as VisualElement; if (Container != null) { _gesture = new TouchNSClickGestureRecognizer(_effect, Container); Container.AddGestureRecognizer(_gesture); Container.AddSubview(_mouseTrackingView = new MouseTrackingView(_effect)); } }
protected override void OnAttached() { effect = TouchEffect.PickFrom(Element); if (effect?.IsDisabled ?? true) { return; } effect.Element = (VisualElement)Element; if (Container != null) { gesture = new TouchNSClickGestureRecognizer(effect, Container); Container.AddGestureRecognizer(gesture); Container.AddSubview(mouseTrackingView = new MouseTrackingView(effect)); } }
protected override void OnDetached() { if (effect?.Element == null) { return; } mouseTrackingView?.RemoveFromSuperview(); mouseTrackingView?.Dispose(); mouseTrackingView = null; effect.Element = null; effect = null; if (gesture != null) { Container?.RemoveGestureRecognizer(gesture); } gesture?.Dispose(); gesture = null; }
#pragma warning disable IDE0060 public bool ShouldRequireFailure(NSGestureRecognizer gestureRecognizer, NSGestureRecognizer otherGestureRecognizer) #pragma warning restore IDE0060 { return(false); }