| WeakEventListenerTTarget, TSource, TEventArgs Constructor (TTarget, WeakReferenceTSource, ActionTTarget, Object, TEventArgs, ActionWeakEventListenerTTarget, TSource, TEventArgs, TSource, ActionWeakEventListenerTTarget, TSource, TEventArgs, TSource) |
Initializes a new instances of the WeakEventListener class that does not reference both source and target.
Namespace:
TomsToolbox.Essentials
Assembly:
TomsToolbox.Essentials (in TomsToolbox.Essentials.dll)
Syntax public WeakEventListener(
TTarget target,
WeakReference<TSource> source,
Action<TTarget, Object, TEventArgs> onEventAction,
Action<WeakEventListener<TTarget, TSource, TEventArgs>, TSource> onAttachAction,
Action<WeakEventListener<TTarget, TSource, TEventArgs>, TSource> onDetachAction
)
Public Sub New (
target As TTarget,
source As WeakReference(Of TSource),
onEventAction As Action(Of TTarget, Object, TEventArgs),
onAttachAction As Action(Of WeakEventListener(Of TTarget, TSource, TEventArgs), TSource),
onDetachAction As Action(Of WeakEventListener(Of TTarget, TSource, TEventArgs), TSource)
)
Parameters
- target
- Type: TTarget
Instance subscribing to the event. The instance will not be referenced. - source
- Type: SystemWeakReferenceTSource
Weak reference to the instance providing the event. When using this constructor the source will not be referenced, too. - onEventAction
- Type: SystemActionTTarget, Object, TEventArgs
The static method to call when a event is received. - onAttachAction
- Type: SystemActionWeakEventListenerTTarget, TSource, TEventArgs, TSource
The static action to attach to the event(s). - onDetachAction
- Type: SystemActionWeakEventListenerTTarget, TSource, TEventArgs, TSource
The static action to detach from the event(s).
See Also