Export (0) Print
Expand All

WeakEventManager.Purge Method

Removes inactive listener entries from the data list for the provided source. Returns true if some entries were actually removed from the list.

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

protected virtual bool Purge (
	Object source,
	Object data,
	bool purgeAll
protected boolean Purge (
	Object source, 
	Object data, 
	boolean purgeAll
protected function Purge (
	source : Object, 
	data : Object, 
	purgeAll : boolean
) : boolean
You cannot use methods in XAML.



Source for events being listened to.


The data to check. This object is expected to be a WeakEventManager.ListenerList implementation.


Set to true to stop listening to source, and completely remove all entries from data.

Return Value

true if some entries were actually removed; otherwise, false.

Purge has a default implementation that will remove all entries when data is a WeakEventManager.ListenerList.

Notes to Implementers: If the underlying type for the Item is something other than WeakEventManager.ListenerList, or contains data beyond a WeakEventManager.ListenerList, you must override Purge. The override should provide purge behavior for the alternate type items list. Generally the override should provide behavior without calling the base implementation; if a specific WeakEventManager.ListenerList still needs clearing, call Purge.

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

Community Additions

© 2014 Microsoft