InkCanvas.SelectionMoving Evento

Definição

Ocorre antes dos traços e elementos selecionados serem movidos.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 

Exemplos

O exemplo a seguir impede que o usuário mova os itens selecionados verticalmente InkCanvasem um.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

Comentários

Esse evento ocorre depois que o usuário solicita que uma seleção de traços e/ou elementos seja movida, mas antes de a alteração ser aplicada.This event occurs after the user requests that a selection of strokes and/or elements be moved, but before the change is applied.

O manipulador de eventos recebe um argumento do InkCanvasSelectionEditingEventArgs tipo com duas propriedades OldRectangle : NewRectanglee.The event handler receives an argument of type InkCanvasSelectionEditingEventArgs with two properties: OldRectangle and NewRectangle. OldRectangledefine os limites da seleção antes da movimentação e NewRectangle define os limites da seleção após a movimentação.OldRectangle defines the boundaries of the selection before the move and NewRectangle defines the boundaries of the selection after the move.

Depois que a alteração for aplicada, SelectionMoved o evento ocorrerá.After the change is applied, the SelectionMoved event will occur.

Aplica-se a

Veja também