WeakEventManager.DeliverEvent Method

Delivers the event being managed to each listener.

Namespace:  System.Windows
Assembly:  WindowsBase (in WindowsBase.dll)

protected void DeliverEvent(
	Object sender,
	EventArgs args
)

Parameters

sender
Type: System.Object

The object on which the event is being handled.

args
Type: System.EventArgs

An EventArgs that contains the event data for the event to deliver.

Call the DeliverEvent method from within the event handlers that are added or removed by the StartListening and StopListening implementations of subclasses.

If you call the ProtectedAddListener method in your AddListener implementation of your class, the list of listeners receiving the event is kept in an underlying collection. (AddListener is not part of an interface or class contract. AddListener is the suggested name for the method of your manager class that calls ProtectedAddListener and adds weak event pattern listeners for the event.)

ProtectedAddListener adds listeners to a single list. If your manager implementation maintains more than one list of listeners per event, do not use DeliverEvent or ProtectedAddListener. Instead, your implementation should create its own WeakEventManager.ListenerList instances, AddListener should add listeners to the appropriate list, and events should be delivered to the appropriate listener list by calling DeliverEventToList.

.NET Framework

Supported in: 4.5.2, 4.5.1, 4.5, 4, 3.5, 3.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

Was this page helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2014 Microsoft