ObservableCollection<T>.OnCollectionChanged Método

Definición

Genera el evento CollectionChanged con los argumentos proporcionados.

protected:
 virtual void OnCollectionChanged(System::Collections::Specialized::NotifyCollectionChangedEventArgs ^ e);
protected virtual void OnCollectionChanged (System.Collections.Specialized.NotifyCollectionChangedEventArgs e);
abstract member OnCollectionChanged : System.Collections.Specialized.NotifyCollectionChangedEventArgs -> unit
override this.OnCollectionChanged : System.Collections.Specialized.NotifyCollectionChangedEventArgs -> unit
Protected Overridable Sub OnCollectionChanged (e As NotifyCollectionChangedEventArgs)

Parámetros

e
NotifyCollectionChangedEventArgs

Argumentos del evento que se está generando.

Ejemplos

Al invalidar este método, llame a la implementación base o use el BlockReentrancy método para controlar los cambios de colección reentrantes, como en el ejemplo siguiente:

using (BlockReentrancy())
{
    // OnCollectionChanged call
}
Using BlockReentrancy()
    ' OnCollectionChanged call
End Using

Comentarios

Las propiedades y los métodos que modifican esta colección generan el CollectionChanged evento a través de este virtual método.

Se aplica a