Export (0) Print
Expand All

InkCanvas.SelectionMoving Event

Occurs at the onset of the selected strokes and elements being moved.

Namespace: System.Windows.Controls
Assembly: PresentationFramework (in presentationframework.dll)
XML Namespace:  http://schemas.microsoft.com/winfx/2006/xaml/presentation

public event InkCanvasSelectionEditingEventHandler SelectionMoving
/** @event */
public void add_SelectionMoving (InkCanvasSelectionEditingEventHandler value)

/** @event */
public void remove_SelectionMoving (InkCanvasSelectionEditingEventHandler value)

In JScript, you can handle the events defined by a class, but you cannot define your own.
<object SelectionMoving="InkCanvasSelectionEditingEventHandler" .../>

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

The event handler receives an argument of type InkCanvasSelectionEditingEventArgs that contains two properties, OldRectangle and NewRectangle, which respectively contain the rectangle that defines the boundaries of the selection before the move and the rectangle that defines the boundaries of the selection after the move.

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

The following example prevents the user from vertically moving the selected items 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);
    
}

Windows 98, Windows Server 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

.NET Framework

Supported in: 3.0

Community Additions

ADD
Show:
© 2014 Microsoft