ManipulationStartingRoutedEventArgs ManipulationStartingRoutedEventArgs ManipulationStartingRoutedEventArgs ManipulationStartingRoutedEventArgs Class


Provides data for the ManipulationStarting, event.

public : sealed class ManipulationStartingRoutedEventArgs : RoutedEventArgs, IManipulationStartingRoutedEventArgs
struct winrt::Windows::UI::Xaml::Input::ManipulationStartingRoutedEventArgs : RoutedEventArgs, IManipulationStartingRoutedEventArgs
public sealed class ManipulationStartingRoutedEventArgs : RoutedEventArgs, IManipulationStartingRoutedEventArgs
Public NotInheritable Class ManipulationStartingRoutedEventArgs Inherits RoutedEventArgs Implements IManipulationStartingRoutedEventArgs
Windows 10 requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)


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()
    forceManipulationsToEnd = false;
    ManipulateMe.ManipulationStarting += 
        new ManipulationStartingEventHandler(
    ManipulateMe.ManipulationStarted += 
        new ManipulationStartedEventHandler(
    ManipulateMe.ManipulationDelta += 
        new ManipulationDeltaEventHandler(
    ManipulateMe.ManipulationCompleted += 
        new ManipulationCompletedEventHandler(
    ManipulateMe.ManipulationInertiaStarting += 
        new ManipulationInertiaStartingEventHandler(

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


    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)

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

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

Public Sub New()
    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
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 _


    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
        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)
End Sub

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


ManipulationStartingRoutedEventArgs() ManipulationStartingRoutedEventArgs() ManipulationStartingRoutedEventArgs() ManipulationStartingRoutedEventArgs()

Initializes a new instance of the ManipulationStartingRoutedEventArgs class.

public : ManipulationStartingRoutedEventArgs()
ManipulationStartingRoutedEventArgs() const;
public ManipulationStartingRoutedEventArgs()
Public Sub New()


Container Container Container Container

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

public : UIElement Container { get; set; }
UIElement Container(); void Container(UIElement container);
public UIElement Container { get; set; }
Public ReadWrite Property Container As UIElement
UIElement UIElement

The UIElement that is considered the container of the manipulation.


Handled Handled Handled Handled

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

public : Platform::Boolean Handled { get; set; }
bool Handled(); void Handled(bool handled);
public bool Handled { get; set; }
Public ReadWrite Property Handled As 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. The default is false.

See Also

Mode Mode Mode Mode

Gets or sets which types of manipulations are possible.

public : ManipulationModes Mode { get; set; }
ManipulationModes Mode(); void Mode(ManipulationModes mode);
public ManipulationModes Mode { get; set; }
Public ReadWrite Property Mode As ManipulationModes
ManipulationModes ManipulationModes

One of the enumeration values. The default is All.

OriginalSource OriginalSource OriginalSource OriginalSource

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

Pivot Pivot Pivot Pivot

Gets or sets an object that describes the pivot for a single-point manipulation.

public : ManipulationPivot Pivot { get; set; }
ManipulationPivot Pivot(); void Pivot(ManipulationPivot pivot);
public ManipulationPivot Pivot { get; set; }
Public ReadWrite Property Pivot As ManipulationPivot
ManipulationPivot ManipulationPivot

An object that describes the pivot for a single-point manipulation.

See Also

  • Windows.UI.Xaml.RoutedEventArgs ndows.ui.xaml/