Subscribes to the event of the specified source.
public Scope Subscribe(TSource source, TEventHandler handler)
parameter | description |
---|---|
source | The source. |
handler | The event handler. |
A Scope that unsubscribes from the event when disposed.
The Scope holds a strong reference to the event handler, which generally holds a strong reference to the target. To subscribe to an event with a weak reference, call EventInfo.WeakSubscribe.