Прочитај на енглеском Уреди

Делите путем


InkCanvas.SelectionMoving Event

Definition

Occurs before selected strokes and elements are moved.

C#
public event System.Windows.Controls.InkCanvasSelectionEditingEventHandler SelectionMoving;

Event Type

Examples

The following example prevents the user from moving selected items vertically on an InkCanvas.

C#
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);
}

Remarks

This event occurs after the user requests that a selection of strokes and/or elements be moved, but before the change is applied.

The event handler receives an argument of type InkCanvasSelectionEditingEventArgs with two properties: OldRectangle and NewRectangle. OldRectangle defines the boundaries of the selection before the move and NewRectangle defines the boundaries of the selection after the move.

After the change is applied, the SelectionMoved event will occur.

Applies to

Производ Верзије
.NET Framework 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
Windows Desktop 3.0, 3.1, 5, 6, 7, 8, 9, 10

See also