ManipulationCompletedRoutedEventArgs Clase

Definición

Proporciona datos para el evento ManipulationCompleted.

public ref class ManipulationCompletedRoutedEventArgs 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 ManipulationCompletedRoutedEventArgs 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 ManipulationCompletedRoutedEventArgs : RoutedEventArgs
Public NotInheritable Class ManipulationCompletedRoutedEventArgs
Inherits RoutedEventArgs
Herencia
Object Platform::Object IInspectable RoutedEventArgs ManipulationCompletedRoutedEventArgs
Atributos

Ejemplos

En el ejemplo de código siguiente se muestra el escenario 4 del ejemplo de entrada. Este código muestra algunos patrones de uso para la manipulación directa mediante los eventos ManipulationStarting, ManipulationStarted, ManipulationDelta, ManipulationInertiaStarting y 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();
}

Constructores

ManipulationCompletedRoutedEventArgs()

Inicializa una nueva instancia de la clase ManipulationCompletedRoutedEventArgs .

Propiedades

Container

Obtiene el uiElement que se considera el contenedor de la manipulación.

Cumulative

Obtiene los cambios generales desde el principio de la manipulación.

Handled

Obtiene o establece un valor que marca el evento enrutado como controlado. Establecer en true impide que la mayoría de los controladores a lo largo de la ruta de eventos controlen de nuevo el mismo evento.

IsInertial

Obtiene si el evento ManipulationCompleted se produce durante la inercia.

OriginalSource

Obtiene una referencia al objeto que generó el evento. Suele ser una parte de plantilla de un control en lugar de un elemento que se declaró en la interfaz de usuario de la aplicación.

(Heredado de RoutedEventArgs)
PointerDeviceType

Obtiene pointerDeviceType para el dispositivo de puntero implicado en la manipulación.

Position

Obtiene las coordenadas de pantalla x e y de la entrada táctil en la posición completada.

Velocities

Obtiene las velocidades que se utilizan para la manipulación.

Se aplica a

Consulte también

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