// </Snippet_GamePiece_PrivateProperties> /** Manipulation and Inertia events ********/ // <Snippet_GamePiece_OnManipulationStarted> #region OnManipulationStarted private void OnManipulationStarted(object sender, Manipulation2DStartedEventArgs e) { if (inertiaProcessor.IsRunning) { inertiaProcessor.Complete(Timestamp); } processInertia = false; }
/// <summary> /// Handles the Affine2DManipulationStarted event of the ManipulationProcessor control. /// </summary> /// <param name="sender">The source of the event.</param> /// <param name="e">The <see cref="System.Windows.Input.ManipulationStartedEventArgs"/> instance containing the event data.</param> private void ContentManipulationProcessor_Affine2DManipulationStarted(object sender, Manipulation2DStartedEventArgs e) { if (_inertiaTimer.IsEnabled) { _inertiaTimer.Stop(); _inertiaProcessor.Complete(DateTime.UtcNow.Ticks); } }
/// <summary> /// Stops inertia. /// </summary> private void StopInertia() { if (_inertiaProcessor.IsRunning) { _inertiaProcessor.Complete(Timestamp); } // always stop the timer _inertiaTimer.Stop(); }