WeakEventManager Class
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Manages weak event subscriptions, preventing memory leaks by maintaining weak references to handlers.
public ref class WeakEventManager
public class WeakEventManager
type WeakEventManager = class
Public Class WeakEventManager
- Inheritance
-
WeakEventManager
Constructors
WeakEventManager() |
Methods
AddEventHandler(Delegate, String) |
Adds an event handler for the specified event, storing a weak reference to the handler's target. |
AddEventHandler<TEventArgs>(EventHandler<TEventArgs>, String) |
Adds an event handler for the specified event, storing a weak reference to the handler's target. |
HandleEvent(Object, Object, String) |
Invokes the handlers registered for the specified event. Removes handlers whose targets have been garbage collected. |
RemoveEventHandler(Delegate, String) |
Removes a previously added event handler for the specified event. |
RemoveEventHandler<TEventArgs>(EventHandler<TEventArgs>, String) |
Removes a previously added event handler for the specified event. |