private int mScrollDuration = 125;
private int mPageWidth = 0;
private float mPageFlickThreshold = 0.4f;
+ private float mScrollingEventThreshold = 0.00001f;
private class ScrollableBaseCustomLayout : LayoutGroup
{
public float DecelerationThreshold { get; set; } = 0.1f;
/// <summary>
+ /// Scrolling event will be thrown when this amount of scroll positino is changed.
+ /// </summary>
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public float ScrollingEventThreshold
+ {
+ get
+ {
+ return mScrollingEventThreshold;
+ }
+ set
+ {
+ if (mScrollingEventThreshold != value && value > 0)
+ {
+ ContentContainer.RemovePropertyNotification(propertyNotification);
+ propertyNotification = ContentContainer.AddPropertyNotification("position", PropertyCondition.Step(value));
+ propertyNotification.Notified += OnPropertyChanged;
+ mScrollingEventThreshold = value;
+ }
+ }
+ }
+
+
+ /// <summary>
/// Page will be changed when velocity of panning is over threshold.
/// The unit of threshold is pixel per milisec.
/// </summary>
Layout = new AbsoluteLayout() { SetPositionByLayout = false },
};
ContentContainer.Relayout += OnScrollingChildRelayout;
- propertyNotification = ContentContainer.AddPropertyNotification("position", PropertyCondition.Step(1.0f));
+ propertyNotification = ContentContainer.AddPropertyNotification("position", PropertyCondition.Step(mScrollingEventThreshold));
propertyNotification.Notified += OnPropertyChanged;
base.Add(ContentContainer);
mPanGestureDetector.Dispose();
mPanGestureDetector = null;
}
+
+ propertyNotification.Dispose();
}
base.Dispose(type);
}