StrokeCollection.StrokesChanged 事件
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
發生於集合中的 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