Click or drag to resize

WeakEventListenerTTarget, TSource, TEventArgs Constructor (TTarget, TSource, ActionTTarget, Object, TEventArgs, ActionWeakEventListenerTTarget, TSource, TEventArgs, TSource, ActionWeakEventListenerTTarget, TSource, TEventArgs, TSource)

Initializes a new instances of the WeakEventListener class that references the source but not the target.

Namespace:  TomsToolbox.Essentials
Assembly:  TomsToolbox.Essentials (in TomsToolbox.Essentials.dll)
Syntax
public WeakEventListener(
	TTarget target,
	TSource source,
	Action<TTarget, Object, TEventArgs> onEventAction,
	Action<WeakEventListener<TTarget, TSource, TEventArgs>, TSource> onAttachAction,
	Action<WeakEventListener<TTarget, TSource, TEventArgs>, TSource> onDetachAction
)

Parameters

target
Type: TTarget
Instance subscribing to the event. The instance will not be referenced.
source
Type: TSource
Instance providing the event. The instance will be referenced.
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