| WeakEventListenerTTarget, TSource, TEventArgs(TTarget, WeakReferenceTSource, ActionTTarget, Object, TEventArgs, ActionWeakEventListenerTTarget, TSource, TEventArgs, TSource, ActionWeakEventListenerTTarget, TSource, TEventArgs, TSource) Constructor |
Initializes a new instances of the WeakEventListener class that does not reference both source and target.
Namespace: TomsToolbox.EssentialsAssembly: TomsToolbox.Essentials (in TomsToolbox.Essentials.dll) Version: 2.21.0+44d18b541fc9419ec3c549350a832394661b2a4d
XMLNS for XAML: Not mapped to an xmlns.
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 TTarget
- Instance subscribing to the event. The instance will not be referenced.
- source WeakReferenceTSource
- Weak reference to the instance providing the event. When using this constructor the source will not be referenced, too.
- onEventAction ActionTTarget, Object, TEventArgs
- The static method to call when a event is received.
- onAttachAction ActionWeakEventListenerTTarget, TSource, TEventArgs, TSource
- The static action to attach to the event(s).
- onDetachAction ActionWeakEventListenerTTarget, TSource, TEventArgs, TSource
- The static action to detach from the event(s).
See Also