StrokesChanged Event
Collapse the table of content
Expand the table of content

StrokeCollection.StrokesChanged Event

 

Occurs when a Stroke in the collection changes.

Namespace:   System.Windows.Ink
Assembly:  PresentationCore (in PresentationCore.dll)

public event StrokeCollectionChangedEventHandler StrokesChanged

The following example adds the current time as a custom property to each new stroke in the StrokesChanged event handler. The example assumes that the StrokesChanged event is connected to the event handler defined in this example.

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

void Strokes_StrokesChanged(object sender, StrokeCollectionChangedEventArgs args)
{
    foreach (Stroke s in args.Added)
    {
        s.AddPropertyData(currentTimeGuid, DateTime.Now);
    }
}

.NET Framework
Available since 3.0
Return to top
Show:
© 2016 Microsoft