예제 #1
0
 protected override void OnManipulationCompleted(ManipulationCompletedEventArgs e)
 {
     if (_panningInfo != null)
     {
         if (!(e.IsInertial && CompleteScrollManipulation))
         {
             if (e.IsInertial &&
                 !DoubleUtil.AreClose(e.FinalVelocities.LinearVelocity, new Vector()) &&
                 !IsPastInertialLimit())
             {
                 // if an inertial manipualtion gets completed without its LinearVelocity reaching 0,
                 // then most probably it was forced to complete by other manipulation.
                 // In such case we dont want the next manipulation to ever cancel.
                 ForceNextManipulationComplete = true;
             }
             else
             {
                 if (!e.IsInertial && !_panningInfo.IsPanning && !ForceNextManipulationComplete)
                 {
                     // If we are not scrolling yet and the manipulation gets completed, then cancel the manipulation.
                     e.Cancel();
                 }
                 ForceNextManipulationComplete = false;
             }
         }
         _panningInfo = null;
         CompleteScrollManipulation = false;
         e.Handled = true;
     }
 }
예제 #2
0
        private void OnManipulationCompleted(object sender, ManipulationCompletedEventArgs e)
        {
            if (e.TotalManipulation.Translation.Y == 0)
            {
                e.Cancel();
            }

            e.Handled = true;
        }