Bagikan melalui


StrokeCollection.StrokesChanged Kejadian

Definisi

Terjadi ketika Stroke dalam koleksi berubah.

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 

Jenis Acara

Contoh

Contoh berikut menambahkan waktu saat ini sebagai properti kustom ke setiap goresan baru di penanganan StrokesChanged aktivitas. Contoh mengasumsikan bahwa StrokesChanged peristiwa terhubung ke penanganan aktivitas yang ditentukan dalam contoh ini.

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

Berlaku untuk