ManipulationCompletedRoutedEventArgs-Klasse

ManipulationCompletedRoutedEventArgs Class

Stellt Daten für das ManipulationCompleted-Ereignis bereit.

Vererbung

Object
  RoutedEventArgs
    ManipulationCompletedRoutedEventArgs

Syntax


public sealed class ManipulationCompletedRoutedEventArgs : RoutedEventArgs

Attribute

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

Member

ManipulationCompletedRoutedEventArgsKlasse hat diese Membertypen:

Konstruktoren

ManipulationCompletedRoutedEventArgsKlasse hat diese Konstruktoren.

KonstruktorBeschreibung
ManipulationCompletedRoutedEventArgs Initializes a new instance of the ManipulationCompletedRoutedEventArgs class.

 

Methoden

The ManipulationCompletedRoutedEventArgs Klasse erbt Methoden von Object Klasse.

Eigenschaften

Der ManipulationCompletedRoutedEventArgsKlasse hat diese Eigenschaften.

EigenschaftZugriffstypBeschreibung

Container

SchreibgeschütztGets the UIElement that is considered the container of the manipulation.

Cumulative

SchreibgeschütztGets the overall changes since the beginning of the manipulation.

Handled

Lese-/SchreibzugriffGets 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.

IsInertial

SchreibgeschütztGets whether the ManipulationCompleted event occurs during inertia.

OriginalSource

SchreibgeschütztGets a reference to the object that raised the event. (Geerbt von RoutedEventArgs)

PointerDeviceType

SchreibgeschütztGets the PointerDeviceType for the pointer device involved in the manipulation.

Position

SchreibgeschütztGets the x- and y- screen coordinates of the touch input at completed position.

Velocities

SchreibgeschütztGets the velocities that are used for the manipulation.

 

Beispiele

Im folgenden Codebeispiel wird Szenario 4 aus dem Eingabebeispiel gezeigt. Dieser Code veranschaulicht einige Verwendungsmuster für die direkte Bearbeitung mithilfe der ManipulationStarting-, ManipulationStarted-, ManipulationDelta-, ManipulationInertiaStarting und ManipulationCompleted-Ereignisse.


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();
}


Anforderungen

Mindestens unterstützter Client

Windows 8 [Nur Windows Store-Apps]

Mindestens unterstützter Server

Windows Server 2012 [Nur Windows Store-Apps]

Namespace

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

Metadaten

Windows.winmd

Siehe auch

RoutedEventArgs

 

 

Anzeigen:
© 2018 Microsoft