InkCanvas.SelectionMoving Evento
Definição
Importante
Algumas informações dizem respeito a um produto pré-lançado que pode ser substancialmente modificado antes de ser lançado. A Microsoft não faz garantias, de forma expressa ou implícita, em relação à informação aqui apresentada.
Ocorre antes de 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 seguinte impede o utilizador de mover itens selecionados verticalmente num 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
Observações
Este evento ocorre depois de o utilizador pedir que uma seleção de traços e/ou elementos seja movida, mas antes de a alteração ser aplicada.
O handler de eventos recebe um argumento de tipo InkCanvasSelectionEditingEventArgs com duas propriedades: OldRectangle e NewRectangle. OldRectangle define os limites da seleção antes da jogada e NewRectangle define os limites da seleção após a jogada.
Depois de aplicada a alteração, o SelectionMoved evento ocorrerá.