Beispiel #1
0
        void UpdateManipulationMode()
        {
            ManipulationModes modes = (_element.ManipulationMode == (ManipulationModes.None | ManipulationModes.System)) ? ManipulationModes.None : _element.ManipulationMode;

            if (_mode.TranslateRailX())
            {
                modes |= ManipulationModes.None | ManipulationModes.TranslateRailsX | ManipulationModes.TranslateX;
            }
            if (_mode.TranslateRailY())
            {
                modes |= ManipulationModes.None | ManipulationModes.TranslateRailsY | ManipulationModes.TranslateY;
            }
            if (_mode.TranslateX())
            {
                modes |= ManipulationModes.None | ManipulationModes.TranslateX;
            }
            if (_mode.TranslateY())
            {
                modes |= ManipulationModes.None | ManipulationModes.TranslateY;
            }
            if (_mode.IsInertial())
            {
                modes |= ManipulationModes.None | ManipulationModes.TranslateInertia;
            }
            _element.ManipulationMode = modes;
        }
Beispiel #2
0
 void OnPointerReleased(object sender, PointerRoutedEventArgs e)
 {
     if (_pointerPressed)
     {
         _pointerPressed = false;
         if (_dragStarted)
         {
             Point position = C1InputEventArgs.GetPosition(e, null);
             _points.Push(new KeyValuePair <DateTime, Point>(DateTime.Now, position));
             Point finalVelocities = GetFinalVelocities();
             if ((finalVelocities != new Point()) && _actualMode.IsInertial())
             {
                 StartInertia(e, finalVelocities);
             }
             else
             {
                 Complete(e);
             }
         }
         _points.Clear();
         ReleaseMouseCapture();
     }
 }