InkCanvas.StrokeCollected Event

Occurs when a stroke drawn by the user is added to the Strokes property.

Namespace: System.Windows.Controls
Assembly: PresentationFramework (in presentationframework.dll)
XML Namespace:

public event InkCanvasStrokeCollectedEventHandler StrokeCollected
/** @event */
public void add_StrokeCollected (InkCanvasStrokeCollectedEventHandler value)

/** @event */
public void remove_StrokeCollected (InkCanvasStrokeCollectedEventHandler value)

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

Identifier Field


Routing Strategy




This event is raised when a user completes a stroke with a pointing device. For example, a user completes a stroke by raising the stylus from a digitizer after making a motion.

The event handler receives an argument of type InkCanvasStrokeCollectedEventArgs, which contains a reference to the stroke that was collected. The stroke is also added automatically to the Strokes property of the InkCanvas.

The programmatic addition of a Stroke object to the Strokes collection will not raise this event.

The following example saves the time as a custom property when a user adds a stroke to the InkCanvas.

Guid currentTimeGuid = new Guid("12345678-1234-1234-1234-123456789012");

void inkCanvas1_StrokeCollected(object sender, InkCanvasStrokeCollectedEventArgs e)
    e.Stroke.AddPropertyData(currentTimeGuid, DateTime.Now);


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