ManipulationInertiaStartingRoutedEventArgs ManipulationInertiaStartingRoutedEventArgs ManipulationInertiaStartingRoutedEventArgs Class

Provides data for the ManipulationInertiaStarting event.

Syntax

Declaration

public sealed class ManipulationInertiaStartingRoutedEventArgspublic sealed class ManipulationInertiaStartingRoutedEventArgsPublic NotInheritable Class ManipulationInertiaStartingRoutedEventArgs

Inheritance Hierarchy

Inherited Members

Inherited properties

Remarks

Examples

The following code example shows scenario 4 from the Input sample. This code shows some usage patterns for direct manipulation using the ManipulationStarting, ManipulationStarted, ManipulationDelta, ManipulationInertiaStarting, and ManipulationCompleted events.

private TransformGroup _transformGroup;
private MatrixTransform _previousTransform;
private CompositeTransform _compositeTransform;
private bool forceManipulationsToEnd;

public Scenario4()
{
    this.InitializeComponent();
    forceManipulationsToEnd = false;
    ManipulateMe.ManipulationStarting += 
        new ManipulationStartingEventHandler(
            ManipulateMe_ManipulationStarting);
    ManipulateMe.ManipulationStarted += 
        new ManipulationStartedEventHandler(
            ManipulateMe_ManipulationStarted);
    ManipulateMe.ManipulationDelta += 
        new ManipulationDeltaEventHandler(
            ManipulateMe_ManipulationDelta);
    ManipulateMe.ManipulationCompleted += 
        new ManipulationCompletedEventHandler(
            ManipulateMe_ManipulationCompleted);
    ManipulateMe.ManipulationInertiaStarting += 
        new ManipulationInertiaStartingEventHandler(
            ManipulateMe_ManipulationInertiaStarting);
    InitManipulationTransforms();
}

private void InitManipulationTransforms()
{
    _transformGroup = new TransformGroup();
    _compositeTransform = new CompositeTransform();
    _previousTransform = new MatrixTransform() { 
        Matrix = Matrix.Identity };

    _transformGroup.Children.Add(_previousTransform);
    _transformGroup.Children.Add(_compositeTransform);

    ManipulateMe.RenderTransform = _transformGroup;
}

private void ManipulateMe_ManipulationStarting(object sender, 
    ManipulationStartingRoutedEventArgs e)
{
    forceManipulationsToEnd = false;
    e.Handled = true;
}

private void ManipulateMe_ManipulationStarted(
    object sender, ManipulationStartedRoutedEventArgs e)
{
    e.Handled = true;
}

private void ManipulateMe_ManipulationInertiaStarting(
    object sender, ManipulationInertiaStartingRoutedEventArgs e)
{
    e.Handled = true;
}

private void ManipulateMe_ManipulationDelta(
    object sender, ManipulationDeltaRoutedEventArgs e)
{
    if (forceManipulationsToEnd)
    {
        e.Complete();
        return;
    }

    _previousTransform.Matrix = _transformGroup.Value;

    Point center = _previousTransform.TransformPoint(
        new Point(e.Position.X, e.Position.Y));
    _compositeTransform.CenterX = center.X;
    _compositeTransform.CenterY = center.Y;

    _compositeTransform.Rotation = (e.Delta.Rotation * 180) / Math.PI;
    _compositeTransform.ScaleX = 
        _compositeTransform.ScaleY = e.Delta.Scale;
    _compositeTransform.TranslateX = e.Delta.Translation.X;
    _compositeTransform.TranslateY = e.Delta.Translation.Y;

    e.Handled = true;
}

private void ManipulateMe_ManipulationCompleted(object sender, 
    ManipulationCompletedRoutedEventArgs e)
{
    e.Handled = true;
}

private void Scenario4Reset(object sender, RoutedEventArgs e)
{
    Scenario4Reset();
}

void Scenario4Reset()
{
    forceManipulationsToEnd = true;
    ManipulateMe.RenderTransform = null;
    InitManipulationTransforms();
}
Private _transformGroup As TransformGroup
Private _previousTransform As MatrixTransform
Private _compositeTransform As CompositeTransform
Private forceManipulationsToEnd As Boolean

Public Sub New()
    Me.InitializeComponent()
    forceManipulationsToEnd = False
    AddHandler ManipulateMe.ManipulationStarting, AddressOf ManipulateMe_ManipulationStarting
    AddHandler ManipulateMe.ManipulationStarted, AddressOf ManipulateMe_ManipulationStarted
    AddHandler ManipulateMe.ManipulationDelta, AddressOf ManipulateMe_ManipulationDelta
    AddHandler ManipulateMe.ManipulationCompleted, AddressOf ManipulateMe_ManipulationCompleted
    InitManipulationTransforms()
End Sub

''' <summary>
''' Invoked when this page is about to be displayed in a Frame.
''' </summary>
''' <param name="e">Event data that describes how this page was reached.  The Parameter
''' property is typically used to configure the page.</param>
Protected Overrides Sub OnNavigatedTo(e As NavigationEventArgs)
End Sub

Private Sub InitManipulationTransforms()
    _transformGroup = New TransformGroup()
    _compositeTransform = New CompositeTransform()
    _previousTransform = New MatrixTransform() With { _
        .Matrix = Matrix.Identity _
    }

    _transformGroup.Children.Add(_previousTransform)
    _transformGroup.Children.Add(_compositeTransform)

    ManipulateMe.RenderTransform = _transformGroup
End Sub

Private Sub ManipulateMe_ManipulationStarting(sender As Object, e As ManipulationStartingRoutedEventArgs)
    forceManipulationsToEnd = False
    e.Handled = True
End Sub

Private Sub ManipulateMe_ManipulationStarted(sender As Object, e As ManipulationStartedRoutedEventArgs)
    e.Handled = True
End Sub

Private Sub ManipulateMe_ManipulationDelta(sender As Object, e As ManipulationDeltaRoutedEventArgs)
    If forceManipulationsToEnd Then
        e.Complete()
        Exit Sub
    End If

    _previousTransform.Matrix = _transformGroup.Value

    Dim center As Point = _previousTransform.TransformPoint(New Point(e.Position.X, e.Position.Y))
    _compositeTransform.CenterX = center.X
    _compositeTransform.CenterY = center.Y

    _compositeTransform.Rotation = (e.Delta.Rotation * 180) / Math.PI
    _compositeTransform.ScaleX = InlineAssignHelper(_compositeTransform.ScaleY, e.Delta.Scale)
    _compositeTransform.TranslateX = e.Delta.Translation.X
    _compositeTransform.TranslateY = e.Delta.Translation.Y

    e.Handled = True
End Sub

Private Sub ManipulateMe_ManipulationCompleted(sender As Object, e As ManipulationCompletedRoutedEventArgs)
    e.Handled = True
End Sub

Private Sub Scenario4ResetMethod(sender As Object, e As RoutedEventArgs)
    Reset()
End Sub

Private Sub Reset()
    forceManipulationsToEnd = True
    ManipulateMe.RenderTransform = Nothing
    InitManipulationTransforms()
End Sub
Private Shared Function InlineAssignHelper(Of T)(ByRef target As T, value As T) As T
    target = value
    Return value
End Function

Constructors summary

Initializes a new instance of the ManipulationInertiaStartingRoutedEventArgs class.

Properties summary

Gets the UIElement that is considered the container of the manipulation.

Gets the overall changes since the beginning of the manipulation.

Gets the most recent changes of the current manipulation, as a ManipulationDeltaRoutedEventArgs.

Get or sets the rate of slowdown of expansion inertial movement.

Gets or sets a value that marks the routed event as handled. A true value for Handled prevents most handlers along the event route from handling the same event again.

Gets the PointerDeviceType for the pointer device involved in the manipulation.

Gets information about the rotation information associated with the manipulation for this event occurrence.

Gets information about the translation information associated with the manipulation for this event occurrence.

Gets the rates of the most recent changes to the manipulation.

Constructors

  • ManipulationInertiaStartingRoutedEventArgs()
    ManipulationInertiaStartingRoutedEventArgs()
    ManipulationInertiaStartingRoutedEventArgs()
    ManipulationInertiaStartingRoutedEventArgs()

    Initializes a new instance of the ManipulationInertiaStartingRoutedEventArgs class.

    public ManipulationInertiaStartingRoutedEventArgs()public New()Public Sub New()public ManipulationInertiaStartingRoutedEventArgs()

Properties

  • Container
    Container
    Container
    Container

    Gets the UIElement that is considered the container of the manipulation.

    public UIElement Container { get; }public UIElement Container { get; }Public ReadOnly Property Container As UIElementpublic UIElement Container { get; }

    Property Value

    Remarks

  • Cumulative
    Cumulative
    Cumulative
    Cumulative

    Gets the overall changes since the beginning of the manipulation.

    public ManipulationDelta Cumulative { get; }public ManipulationDelta Cumulative { get; }Public ReadOnly Property Cumulative As ManipulationDeltapublic ManipulationDelta Cumulative { get; }

    Property Value

  • Delta
    Delta
    Delta
    Delta

    Gets the most recent changes of the current manipulation, as a ManipulationDeltaRoutedEventArgs.

    public ManipulationDelta Delta { get; }public ManipulationDelta Delta { get; }Public ReadOnly Property Delta As ManipulationDeltapublic ManipulationDelta Delta { get; }

    Property Value

  • ExpansionBehavior
    ExpansionBehavior
    ExpansionBehavior
    ExpansionBehavior

    Get or sets the rate of slowdown of expansion inertial movement.

    public InertiaExpansionBehavior ExpansionBehavior { get; set; }public InertiaExpansionBehavior ExpansionBehavior { get; set; }Public ReadWrite Property ExpansionBehavior As InertiaExpansionBehaviorpublic InertiaExpansionBehavior ExpansionBehavior { get; set; }

    Property Value

  • Handled
    Handled
    Handled
    Handled

    Gets or sets a value that marks the routed event as handled. A true value for Handled prevents most handlers along the event route from handling the same event again.

    public bool Handled { get; set; }public bool Handled { get; set; }Public ReadWrite Property Handled As boolpublic bool Handled { get; set; }

    Property Value

    • bool
      bool
      bool

      true to mark the routed event handled. false to leave the routed event unhandled, which permits the event to potentially route further and be acted on by other handlers. The default is false.

  • PointerDeviceType
    PointerDeviceType
    PointerDeviceType
    PointerDeviceType

    Gets the PointerDeviceType for the pointer device involved in the manipulation.

    public PointerDeviceType PointerDeviceType { get; }public PointerDeviceType PointerDeviceType { get; }Public ReadOnly Property PointerDeviceType As PointerDeviceTypepublic PointerDeviceType PointerDeviceType { get; }

    Property Value

  • RotationBehavior
    RotationBehavior
    RotationBehavior
    RotationBehavior

    Gets information about the rotation information associated with the manipulation for this event occurrence.

    public InertiaRotationBehavior RotationBehavior { get; set; }public InertiaRotationBehavior RotationBehavior { get; set; }Public ReadWrite Property RotationBehavior As InertiaRotationBehaviorpublic InertiaRotationBehavior RotationBehavior { get; set; }

    Property Value

  • TranslationBehavior
    TranslationBehavior
    TranslationBehavior
    TranslationBehavior

    Gets information about the translation information associated with the manipulation for this event occurrence.

    public InertiaTranslationBehavior TranslationBehavior { get; set; }public InertiaTranslationBehavior TranslationBehavior { get; set; }Public ReadWrite Property TranslationBehavior As InertiaTranslationBehaviorpublic InertiaTranslationBehavior TranslationBehavior { get; set; }

    Property Value

  • Velocities
    Velocities
    Velocities
    Velocities

    Gets the rates of the most recent changes to the manipulation.

    public ManipulationVelocities Velocities { get; }public ManipulationVelocities Velocities { get; }Public ReadOnly Property Velocities As ManipulationVelocitiespublic ManipulationVelocities Velocities { get; }

    Property Value

Device family

Windows 10 (introduced v10.0.10240.0)

API contract

Windows.Foundation.UniversalApiContract (introduced v1)

Attributes

Windows.Foundation.Metadata.ActivatableAttribute
Windows.Foundation.Metadata.ContractVersionAttribute
Windows.Foundation.Metadata.MarshalingBehaviorAttribute
Windows.Foundation.Metadata.ThreadingAttribute
Windows.Foundation.Metadata.WebHostHiddenAttribute

Details

Assembly

Windows.UI.Xaml.Input.dll