Пример #1
0
 void RaiseDragDelta(RoutedEventArgs originalArgs, Point cumulativeTranslation, Point deltaTranslation, bool isInertial)
 {
     if (DragDelta != null)
     {
         bool flag  = _actualMode.TranslateX() && (!_actualMode.TranslateRailY() || (_direction != C1DragDirection.Vertical));
         bool flag2 = _actualMode.TranslateY() && (!_actualMode.TranslateRailX() || (_direction != C1DragDirection.Horizontal));
         DragDelta(_element, new C1DragDeltaEventArgs(this, originalArgs, _pointerType, new Point(flag ? deltaTranslation.X : 0.0, flag2 ? deltaTranslation.Y : 0.0), new Point(flag ? cumulativeTranslation.X : 0.0, flag2 ? cumulativeTranslation.Y : 0.0), isInertial));
     }
 }
Пример #2
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;
        }