ManipulationInertiaStartingRoutedEventArgs-Klasse

ManipulationInertiaStartingRoutedEventArgs Class

Stellt Daten für das ManipulationInertiaStarting-Ereignis bereit.

Vererbung

Object
  RoutedEventArgs
    ManipulationInertiaStartingRoutedEventArgs

Syntax


public sealed class ManipulationInertiaStartingRoutedEventArgs : RoutedEventArgs

Attribute

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

Member

ManipulationInertiaStartingRoutedEventArgsKlasse hat diese Membertypen:

Konstruktoren

ManipulationInertiaStartingRoutedEventArgsKlasse hat diese Konstruktoren.

KonstruktorBeschreibung
ManipulationInertiaStartingRoutedEventArgs Initializes a new instance of the ManipulationInertiaStartingRoutedEventArgs class.

 

Methoden

The ManipulationInertiaStartingRoutedEventArgs Klasse erbt Methoden von Object Klasse.

Eigenschaften

Der ManipulationInertiaStartingRoutedEventArgsKlasse 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.

Delta

SchreibgeschütztGets the most recent changes of the current manipulation, as a ManipulationDelta.

ExpansionBehavior

Lese-/SchreibzugriffGet or sets the rate of slowdown of expansion inertial movement.

Handled

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

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.

RotationBehavior

Lese-/SchreibzugriffGets information about the rotation information associated with the manipulation for this event occurrence.

TranslationBehavior

Lese-/SchreibzugriffGets information about the translation information associated with the manipulation for this event occurrence.

Velocities

SchreibgeschütztGets the rates of the most recent changes to 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:
© 2017 Microsoft