StrokeCollection.StrokesChanged 事件

定义

当集合内的 Stroke 更改时发生。

public:
 event System::Windows::Ink::StrokeCollectionChangedEventHandler ^ StrokesChanged;
public event System.Windows.Ink.StrokeCollectionChangedEventHandler StrokesChanged;
member this.StrokesChanged : System.Windows.Ink.StrokeCollectionChangedEventHandler 
Public Custom Event StrokesChanged As StrokeCollectionChangedEventHandler 
Public Event StrokesChanged As StrokeCollectionChangedEventHandler 

事件类型

示例

以下示例将当前时间作为自定义属性添加到事件处理程序中的每个 StrokesChanged 新笔划。 该示例假定 事件 StrokesChanged 已连接到此示例中定义的事件处理程序。

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);
    }
}
Dim currentTimeGuid As Guid = New Guid("12345678-1234-1234-1234-123456789012")

Private Sub Strokes_StrokesChanged(ByVal sender As Object, _
            ByVal args As StrokeCollectionChangedEventArgs)

    Dim s As Stroke

    For Each s In args.Added
        s.AddPropertyData(currentTimeGuid, DateTime.Now)
    Next

End Sub

适用于