Share via


ManipulationInertiaStartingRoutedEventArgs Classe

Definizione

Fornisce i dati per l'evento ManipulationInertiaStarting.

public ref class ManipulationInertiaStartingRoutedEventArgs sealed : RoutedEventArgs
/// [Windows.Foundation.Metadata.Activatable(65536, "Microsoft.UI.Xaml.WinUIContract")]
/// [Windows.Foundation.Metadata.ContractVersion(Microsoft.UI.Xaml.WinUIContract, 65536)]
/// [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
/// [Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
class ManipulationInertiaStartingRoutedEventArgs final : RoutedEventArgs
[Windows.Foundation.Metadata.Activatable(65536, "Microsoft.UI.Xaml.WinUIContract")]
[Windows.Foundation.Metadata.ContractVersion(typeof(Microsoft.UI.Xaml.WinUIContract), 65536)]
[Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
[Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
public sealed class ManipulationInertiaStartingRoutedEventArgs : RoutedEventArgs
Public NotInheritable Class ManipulationInertiaStartingRoutedEventArgs
Inherits RoutedEventArgs
Ereditarietà
Object Platform::Object IInspectable RoutedEventArgs ManipulationInertiaStartingRoutedEventArgs
Attributi

Esempio

L'esempio di codice seguente illustra lo scenario 4 dell'esempio di input. Questo codice mostra alcuni modelli di utilizzo per la manipolazione diretta usando gli eventi ManipulationStarting, ManipulationStarted, ManipulationDelta, ManipulationInertiaStarting e ManipulationCompleted .

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

Costruttori

ManipulationInertiaStartingRoutedEventArgs()

Inizializza una nuova istanza della classe ManipulationInertiaStartingRoutedEventArgs .

Proprietà

Container

Ottiene l'oggetto UIElement considerato il contenitore della manipolazione.

Cumulative

Ottiene le modifiche complessive dall'inizio della manipolazione.

Delta

Ottiene le modifiche più recenti della manipolazione corrente, come ManipulationDelta.

ExpansionBehavior

Ottiene o imposta la frequenza di rallentamento del movimento inerziale di espansione.

Handled

Ottiene o imposta un valore che contrassegna l'evento indirizzato come gestito. Un true valore per Handled impedisce alla maggior parte dei gestori lungo la route dell'evento di gestire di nuovo lo stesso evento.

OriginalSource

Ottiene un riferimento all'oggetto che ha generato l'evento. Si tratta spesso di una parte di modello di un controllo anziché di un elemento dichiarato nell'interfaccia utente dell'app.

(Ereditato da RoutedEventArgs)
PointerDeviceType

Ottiene pointerDeviceType per il dispositivo puntatore coinvolto nella manipolazione.

RotationBehavior

Ottiene informazioni sulle informazioni sulla rotazione associate alla manipolazione per questa occorrenza dell'evento.

TranslationBehavior

Ottiene informazioni sulle informazioni di traduzione associate alla manipolazione per questa occorrenza dell'evento.

Velocities

Ottiene la frequenza delle modifiche più recenti alla manipolazione.

Si applica a

Vedi anche

  • <xref:Microsoft.UI.Xaml.RoutedEventArgs%0andows.ui.xaml%2froutedeventargs.md)>