InkCanvas.SelectionMoving InkCanvas.SelectionMoving InkCanvas.SelectionMoving InkCanvas.SelectionMoving Event

Definición

Se produce antes de que los trazos y elementos seleccionados se muevan.Occurs before selected strokes and elements are moved.

public:
 event System::Windows::Controls::InkCanvasSelectionEditingEventHandler ^ SelectionMoving;
public event System.Windows.Controls.InkCanvasSelectionEditingEventHandler SelectionMoving;
member this.SelectionMoving : System.Windows.Controls.InkCanvasSelectionEditingEventHandler 
Public Event SelectionMoving As InkCanvasSelectionEditingEventHandler 

Ejemplos

El ejemplo siguiente impide al usuario mover elementos seleccionados verticalmente en una InkCanvas.The following example prevents the user from moving selected items vertically on an InkCanvas.

void inkCanvas1_SelectionMoving(object sender, InkCanvasSelectionEditingEventArgs e)
{
    // Allow the selection to only move horizontally.
    Rect newRect = e.NewRectangle;
    e.NewRectangle = new Rect(newRect.X, e.OldRectangle.Y, newRect.Width, newRect.Height);
    
}
Private Sub inkCanvas1_SelectionMoving(ByVal sender As Object, _
                               ByVal e As InkCanvasSelectionEditingEventArgs)

    ' Allow the selection to only move horizontally.
    Dim newRect As Rect = e.NewRectangle
    e.NewRectangle = New Rect(newRect.X, e.OldRectangle.Y, newRect.Width, newRect.Height)

End Sub 'inkCanvas1_SelectionMoving

Comentarios

Este evento se produce después de que el usuario solicita que se mueve una selección de trazos o elementos, pero antes de aplicar el cambio.This event occurs after the user requests that a selection of strokes and/or elements be moved, but before the change is applied.

El controlador de eventos recibe un argumento de tipo InkCanvasSelectionEditingEventArgs con dos propiedades: OldRectangle y NewRectangle.The event handler receives an argument of type InkCanvasSelectionEditingEventArgs with two properties: OldRectangle and NewRectangle. OldRectangle define los límites de la selección antes de moverlo y NewRectangle define los límites de la selección después de moverlo.OldRectangle defines the boundaries of the selection before the move and NewRectangle defines the boundaries of the selection after the move.

Después de aplicar el cambio, el SelectionMoved se producirá el evento.After the change is applied, the SelectionMoved event will occur.

Se aplica a

Consulte también: