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

適用於