/// <summary>
        ///     Instantiates a new instance of this class.
        /// </summary>
        internal ManipulationDeltaEventArgs(
            ManipulationDevice manipulationDevice,
            int timestamp,
            IInputElement manipulationContainer,
            Point origin,
            ManipulationDelta delta,
            ManipulationDelta cumulative,
            ManipulationVelocities velocities,
            bool isInertial)
            : base(manipulationDevice, timestamp)
        {
            if (delta == null)
            {
                throw new ArgumentNullException("delta");
            }

            if (cumulative == null)
            {
                throw new ArgumentNullException("cumulative");
            }

            if (velocities == null)
            {
                throw new ArgumentNullException("velocities");
            }

            RoutedEvent = Manipulation.ManipulationDeltaEvent;

            ManipulationContainer  = manipulationContainer;
            ManipulationOrigin     = origin;
            DeltaManipulation      = delta;
            CumulativeManipulation = cumulative;
            Velocities             = velocities;
            IsInertial             = isInertial;
        }
Example #2
0
        /// <summary>
        ///     Instantiates a new instance of this class.
        /// </summary>
        internal ManipulationCompletedEventArgs(
            ManipulationDevice manipulationDevice,
            int timestamp,
            IInputElement manipulationContainer,
            Point origin,
            ManipulationDelta total,
            ManipulationVelocities velocities,
            bool isInertial)
            : base(manipulationDevice, timestamp)
        {
            if (total == null)
            {
                throw new ArgumentNullException("total");
            }

            if (velocities == null)
            {
                throw new ArgumentNullException("velocities");
            }

            RoutedEvent = Manipulation.ManipulationCompletedEvent;

            ManipulationContainer = manipulationContainer;
            ManipulationOrigin    = origin;
            TotalManipulation     = total;
            FinalVelocities       = velocities;
            IsInertial            = isInertial;
        }
        /// <summary>
        ///     Instantiates a new instance of this class.
        /// </summary> 
        internal ManipulationDeltaEventArgs(
            ManipulationDevice manipulationDevice, 
            int timestamp, 
            IInputElement manipulationContainer,
            Point origin, 
            ManipulationDelta delta,
            ManipulationDelta cumulative,
            ManipulationVelocities velocities,
            bool isInertial) 
            : base(manipulationDevice, timestamp)
        { 
            if (delta == null) 
            {
                throw new ArgumentNullException("delta"); 
            }

            if (cumulative == null)
            { 
                throw new ArgumentNullException("cumulative");
            } 
 
            if (velocities == null)
            { 
                throw new ArgumentNullException("velocities");
            }

            RoutedEvent = Manipulation.ManipulationDeltaEvent; 

            ManipulationContainer = manipulationContainer; 
            ManipulationOrigin = origin; 
            DeltaManipulation = delta;
            CumulativeManipulation = cumulative; 
            Velocities = velocities;
            IsInertial = isInertial;
        }
        /// <summary>
        ///     Instantiates a new instance of this class.
        /// </summary>
        internal ManipulationCompletedEventArgs(
            ManipulationDevice manipulationDevice,
            int timestamp, 
            IInputElement manipulationContainer,
            Point origin, 
            ManipulationDelta total,
            ManipulationVelocities velocities,
            bool isInertial)
            : base(manipulationDevice, timestamp)
        {
            if (total == null)
            {
                throw new ArgumentNullException("total");
            }

            if (velocities == null)
            {
                throw new ArgumentNullException("velocities");
            }

            RoutedEvent = Manipulation.ManipulationCompletedEvent;

            ManipulationContainer = manipulationContainer;
            ManipulationOrigin = origin;
            TotalManipulation = total;
            FinalVelocities = velocities;
            IsInertial = isInertial;
        }
Example #5
0
        internal void ApplyParameters(InertiaProcessor2D processor)
        {
            processor.InitialOriginX = (float)ManipulationOrigin.X;
            processor.InitialOriginY = (float)ManipulationOrigin.Y;

            ManipulationVelocities velocities = InitialVelocities;

            InertiaTranslationBehavior.ApplyParameters(_translationBehavior, processor, velocities.LinearVelocity);
            InertiaRotationBehavior.ApplyParameters(_rotationBehavior, processor, velocities.AngularVelocity);
            InertiaExpansionBehavior.ApplyParameters(_expansionBehavior, processor, velocities.ExpansionVelocity);

            if (_inertiaParameters != null)
            {
                for (int i = 0, count = _inertiaParameters.Count; i < count; i++)
                {
                    processor.SetParameters(_inertiaParameters[i]);
                }
            }
        }
        /// <summary>
        ///     Instantiates a new instance of this class. 
        /// </summary> 
        internal ManipulationInertiaStartingEventArgs(
            ManipulationDevice manipulationDevice, 
            int timestamp,
            IInputElement manipulationContainer,
            Point origin,
            ManipulationVelocities initialVelocities, 
            bool isInInertia)
            : base(manipulationDevice, timestamp) 
        { 
            if (initialVelocities == null)
            { 
                throw new ArgumentNullException("initialVelocities");
            }

            RoutedEvent = Manipulation.ManipulationInertiaStartingEvent; 

            ManipulationContainer = manipulationContainer; 
            ManipulationOrigin = origin; 
            InitialVelocities = initialVelocities;
            _isInInertia = isInInertia; 
        }
Example #7
0
        /// <summary>
        ///     Instantiates a new instance of this class.
        /// </summary>
        internal ManipulationInertiaStartingEventArgs(
            ManipulationDevice manipulationDevice,
            int timestamp,
            IInputElement manipulationContainer,
            Point origin,
            ManipulationVelocities initialVelocities,
            bool isInInertia)
            : base(manipulationDevice, timestamp)
        {
            if (initialVelocities == null)
            {
                throw new ArgumentNullException("initialVelocities");
            }

            RoutedEvent = Manipulation.ManipulationInertiaStartingEvent;

            ManipulationContainer = manipulationContainer;
            ManipulationOrigin    = origin;
            InitialVelocities     = initialVelocities;
            _isInInertia          = isInInertia;
        }