if (mScrollEnabled)
{
mPanGestureDetector.Detected += OnPanGestureDetected;
- this.InterceptTouchEvent += OnInterruptTouchingChildTouched;
}
else
{
mPanGestureDetector.Detected -= OnPanGestureDetected;
- this.InterceptTouchEvent -= OnInterruptTouchingChildTouched;
}
}
}
private PropertyNotification propertyNotification;
private float noticeAnimationEndBeforePosition = 0.0f;
private bool readyToNotice = false;
- private bool shouldIntercept = false;
/// <summary>
/// Notice before animation is finished.
mPanGestureDetector.AddDirection(PanGestureDetector.DirectionVertical);
if (mPanGestureDetector.GetMaximumTouchesRequired() < 2) mPanGestureDetector.SetMaximumTouchesRequired(2);
mPanGestureDetector.Detected += OnPanGestureDetected;
- //Interrupt touching when panning is started
- this.InterceptTouchEvent += OnInterruptTouchingChildTouched;
ClippingMode = ClippingModeType.ClipToBoundingBox;
StopScroll();
}
}
- return shouldIntercept;
+ return true;
}
private void OnPropertyChanged(object source, PropertyNotification.NotifyEventArgs args)
private void OnScrollAnimationEnded()
{
scrolling = false;
+ this.InterceptTouchEvent -= OnInterruptTouchingChildTouched;
+
ScrollEventArgs eventArgs = new ScrollEventArgs(ContentContainer.CurrentPosition);
ScrollAnimationEnded?.Invoke(this, eventArgs);
}
mPanGestureDetector.Dispose();
mPanGestureDetector = null;
}
- this.InterceptTouchEvent -= OnInterruptTouchingChildTouched;
propertyNotification.Dispose();
}
if (panGesture.State == Gesture.StateType.Started)
{
- shouldIntercept = false;
readyToNotice = false;
+ //Interrupt touching when panning is started
+ this.InterceptTouchEvent += OnInterruptTouchingChildTouched;
AttachOverShootingShadowView();
Debug.WriteLineIf(LayoutDebugScrollableBase, "Gesture Start");
if (scrolling && !SnapToPage)
}
else if (panGesture.State == Gesture.StateType.Continuing)
{
- shouldIntercept = true;
if (ScrollingDirection == Direction.Horizontal)
{
// if vertical shadow is shown, does not scroll.
totalDisplacementForPan = 0;
scrolling = true;
readyToNotice = true;
- shouldIntercept = false;
OnScrollAnimationStarted();
}
}