 | WeakEventListener<TTarget, TSource, TEventArgs> Class |
Implements a weak event listener that allows the owner to be garbage
collected if its only remaining link is an event handler.
Inheritance HierarchySystem.Object TomsToolbox.Essentials.WeakEventListener<TTarget, TSource, TEventArgs> Namespace: TomsToolbox.EssentialsAssembly: TomsToolbox.Essentials (in TomsToolbox.Essentials.dll) Version: 2.21.0+44d18b541fc9419ec3c549350a832394661b2a4d
XMLNS for XAML: Not mapped to an xmlns.
Syntaxpublic class WeakEventListener<TTarget, TSource, TEventArgs> : IWeakEventListener
where TTarget : class
where TSource : class
Public Class WeakEventListener(Of TTarget As Class, TSource As Class, TEventArgs)
Implements IWeakEventListener
Type Parameters
- TTarget
- Type of the target instance listening for the event.
- TSource
- Type of source instance for the event.
- TEventArgs
- Type of event arguments for the event.
The WeakEventListener<TTarget, TSource, TEventArgs> type exposes the following members.
Constructors | Name | Description |
---|
 | WeakEventListener<TTarget, TSource, TEventArgs>(TTarget, TSource, Action<TTarget, Object, TEventArgs>, Action<WeakEventListener<TTarget, TSource, TEventArgs>, TSource>, Action<WeakEventListener<TTarget, TSource, TEventArgs>, TSource>) |
Initializes a new instances of the WeakEventListener class that references the source but not the target.
|
 | WeakEventListener<TTarget, TSource, TEventArgs>(TTarget, WeakReference<TSource>, Action<TTarget, Object, TEventArgs>, Action<WeakEventListener<TTarget, TSource, TEventArgs>, TSource>, Action<WeakEventListener<TTarget, TSource, TEventArgs>, TSource>) |
Initializes a new instances of the WeakEventListener class that does not reference both source and target.
|
Top
Methods | Name | Description |
---|
 | Detach |
Detaches from the subscribed event.
|
 | OnEvent |
Handler for the subscribed event calls OnEventAction to handle it.
|
Top
Extension Methods
See Also