Windows Dev Center

ManipulationInertiaStartingRoutedEventArgs class

Provides data for the ManipulationInertiaStarting event.

Inheritance

Object
  RoutedEventArgs
    ManipulationInertiaStartingRoutedEventArgs

Syntax


Public NotInheritable Class ManipulationInertiaStartingRoutedEventArgs
    Inherits RoutedEventArgs

Members

The ManipulationInertiaStartingRoutedEventArgs class has these types of members:

Constructors

The ManipulationInertiaStartingRoutedEventArgs class has these constructors.

ConstructorDescription
ManipulationInertiaStartingRoutedEventArgs Initializes a new instance of the ManipulationInertiaStartingRoutedEventArgs class.

 

Methods

The ManipulationInertiaStartingRoutedEventArgs class inherits methods from the Object class.

Properties

The ManipulationInertiaStartingRoutedEventArgs class has these properties.

PropertyAccess typeDescription

Container

Read-onlyGets the UIElement that is considered the container of the manipulation.

Cumulative

Read-onlyGets the overall changes since the beginning of the manipulation.

Delta

Read-onlyGets the most recent changes of the current manipulation, as a ManipulationDelta.

ExpansionBehavior

Read/writeGet or sets the rate of slowdown of expansion inertial movement.

Handled

Read/writeGets 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.

OriginalSource

Read-onlyGets a reference to the object that raised the event. This is often a template part of a control rather than an element that was declared in your app UI. (Inherited from RoutedEventArgs)

PointerDeviceType

Read-onlyGets the PointerDeviceType for the pointer device involved in the manipulation.

RotationBehavior

Read/writeGets information about the rotation information associated with the manipulation for this event occurrence.

TranslationBehavior

Read/writeGets information about the translation information associated with the manipulation for this event occurrence.

Velocities

Read-onlyGets the rates of the most recent changes to the manipulation.

 

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 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


Requirements (Windows 10 device family)

Device family

Universal

API contract

Windows.Foundation.UniversalApiContract, introduced version 1.0

Namespace

Windows.UI.Xaml.Input
Windows::UI::Xaml::Input [C++]

Metadata

Windows.Foundation.UniversalApiContract.winmd

Requirements (Windows 8.x and Windows Phone 8.x)

Minimum supported client

Windows 8 [Windows Store apps only]

Minimum supported server

Windows Server 2012 [Windows Store apps only]

Minimum supported phone

Windows Phone 8.1 [Windows Runtime apps only]

Namespace

Windows.UI.Xaml.Input
Windows::UI::Xaml::Input [C++]

Metadata

Windows.winmd

Attributes

[MarshalingBehavior(Agile)]
[Threading(Both)]
[Version(0x06020000)]
[WebHostHidden()]

See also

Object
RoutedEventArgs

 

 

Show:
© 2015 Microsoft