private void OnPanning(object sender, PannablePanEventArgs e)
 {
     if (e.PanVelocityY != 0D)
     {
         // Perform scrolling.
         // To simplify the implementation of this code sample, the magnitude of the 
         // velocity is not used - we are simply switching the scrolling on and off in 
         // the right direction. 
         // Please note that to scroll down the text should move up, and vice versa.
         _text.Scroll(e.PanVelocityY > 0 ? -1 : 1); 
     }
 }
Exemple #2
0
        private static void OnPanning(object sender, PannablePanEventArgs e)
        {
            var element = sender as FrameworkElement;

            if (null == element)
            {
                return;
            }

            // Raise the panning event.
            element.RaiseEvent(new RoutedPanEventArgs(PanningEvent, element, e.PanVelocityX, e.PanVelocityY));
        }
        private static void OnPanning(object sender, PannablePanEventArgs e)
        {
            var element = sender as FrameworkElement;
            if (null == element)
            {
                return;
            }

            // Raise the panning event.
            element.RaiseEvent(new RoutedPanEventArgs(PanningEvent, element, e.PanVelocityX, e.PanVelocityY));
        }