InkCanvas.StrokeCollected Event

Definition

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

C#
public event System.Windows.Controls.InkCanvasStrokeCollectedEventHandler StrokeCollected;

Event Type

Examples

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

C#

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

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

Remarks

This event is raised when a user completes a stroke using a pointing device. For example, a user might raise a stylus from a digitizer after making a motion, thereby completing a stroke.

The event handler receives an argument of type InkCanvasStrokeCollectedEventArgs, which references the completed stroke. The stroke is also added to the Strokes property of the InkCanvas.

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

Routed Event Information

Item Value
Identifier field StrokeCollectedEvent
Routing strategy Bubbling
Delegate InkCanvasStrokeCollectedEventHandler

Applies to

Produk Versi
.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