This documentation is archived and is not being maintained.

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
protected void DeliverEvent (
	Object sender, 
	EventArgs args
protected function DeliverEvent (
	sender : Object, 
	args : EventArgs
You cannot use methods in XAML.



The object on which the event is being handled.


Event data for the event to deliver.

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

The list of listeners being delivered is the underlying collection of listeners as established with calls to the AddListener implementation of that manager class, if you used ProtectedAddListener in the implementation. (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 WeakEvent 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.

Windows 98, Windows Server 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

.NET Framework

Supported in: 3.0