InkCanvas.SelectionMoving Evento

Definição

Ocorre antes dos traços e elementos selecionados serem movidos.

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

Exemplos

O exemplo a seguir impede que o usuário mova itens selecionados verticalmente em um 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 após o usuário solicitar que uma seleção de traços e/ou elementos seja movida, mas antes que a alteração seja aplicada.

O manipulador de eventos recebe um argumento do tipo InkCanvasSelectionEditingEventArgs com duas propriedades: OldRectangle e NewRectangle. OldRectangle define os limites da seleção antes da movimentação e NewRectangle define os limites da seleção após a movimentação.

Depois que a alteração for aplicada, o SelectionMoved evento ocorrerá.

Aplica-se a

Confira também