ObservableCollection<T>.OnCollectionChanged(NotifyCollectionChangedEventArgs) Método
Definição
Cria o evento CollectionChanged com os argumentos fornecidos.Raises the CollectionChanged event with the provided arguments.
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
Argumentos do evento que está sendo criado.Arguments of the event being raised.
Exemplos
Ao substituir esse método, chame a implementação base ou use o BlockReentrancy método para tratar as alterações de coleção reentrante, como no exemplo a seguir:When overriding this method, either call the base implementation or use the BlockReentrancy method to handle reentrant collection changes, as in the following example:
using (BlockReentrancy())
{
// OnCollectionChanged call
}
Using BlockReentrancy()
' OnCollectionChanged call
End Using
Comentários
Propriedades e métodos que modificam essa coleção geram o CollectionChanged evento por meio desse virtual
método.Properties and methods that modify this collection raise the CollectionChanged event through this virtual
method.