There are still a lot of bugs in the above text, and the implementation is muddy. Recently we have a good look at the scrollview api. below is the refined code, which is much less and accurate.
You only need to write the following code in the corresponding event.
The first status (you can update the blog Park news in the drop-down list ):
Status 2 (prompt that the drop-down range is enough to release and enter the update operation)
Status 3 (the system prompts that the update is in progress and returns to the first status after the update is complete)
Private double actuableOffset, validStartOffset;
Private bool mplStarted;
Protected override void OnManipulationStarted (ManipulationStartedEventArgs e)
{
Base. OnManipulationStarted (e );
MplStarted = true;
}
Protected override void OnManipulationCompleted (ManipulationCompletedEventArgs e)
{
// 150 is the drop-down distance and can be adjusted by yourself
If (actuableOffset> 150 & scrollViewer. VerticalOffset = 0)
{
MessageBox. Show ("Head pull bingo! ");
}
If (actuableOffset <-150 & scrollViewer. VerticalOffset = scrollViewer. ScrollableHeight)
{
MessageBox. Show ("Tail pull bingo! ");
}
Base. OnManipulationCompleted (e );
}
Protected override void OnMouseMove (MouseEventArgs e)
{
// Head capture startRelative
If (scrollViewer. VerticalOffset = 0)
{
If (mplStarted)
{
MplStarted = false;
ValidStartOffset = e. GetPosition (null). Y;
}
ActuableOffset = e. GetPosition (null). Y-validStartOffset;
}
// Tail
If (scrollViewer. VerticalOffset = scrollViewer. ScrollableHeight)
{
If (mplStarted)
{
MplStarted = false;
ValidStartOffset = e. GetPosition (null). Y;
}
ActuableOffset = e. GetPosition (null). Y-validStartOffset;
}
UIControlHelper. FindFirst <rule> (). Title = actuableOffset;
Base. OnMouseMove (e );
}