InkCanvas.SelectionMoving Evento

Definición

Se produce antes de que los trazos y elementos seleccionados se muevan.

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

Tipo de evento

Ejemplos

En el ejemplo siguiente se impide que el usuario mueva los elementos seleccionados verticalmente en un 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

Comentarios

Este evento se produce después de que el usuario solicite que se mueva una selección de trazos o elementos, pero antes de aplicar el cambio.

El controlador de eventos recibe un argumento de tipo InkCanvasSelectionEditingEventArgs con dos propiedades: OldRectangle y NewRectangle. OldRectangle define los límites de la selección antes del movimiento y NewRectangle define los límites de la selección después del movimiento.

Una vez aplicado el cambio, se producirá el SelectionMoved evento.

Se aplica a

Consulte también