private void OnScroll(ScrollEventType type, int oldValue, int newValue, ScrollOrientation orientation)
{
if (Scroll == null) return;
if (orientation == ScrollOrientation.HorizontalScroll)
{
if (type != ScrollEventType.EndScroll && isFirstScrollEventHorizontal)
{
type = ScrollEventType.First;
}
else if (!isFirstScrollEventHorizontal && type == ScrollEventType.EndScroll)
{
isFirstScrollEventHorizontal = true;
}
}
else
{
if (type != ScrollEventType.EndScroll && isFirstScrollEventVertical)
{
type = ScrollEventType.First;
}
else if (!isFirstScrollEventHorizontal && type == ScrollEventType.EndScroll)
{
isFirstScrollEventVertical = true;
}
}
Scroll(this, new ScrollEventArgs(type, oldValue, newValue, orientation));
}