In WeakAction class, what is the different between ActionReference and Reference

Mar 27 at 10:11 AM
Hi

I'm confusing that why ActionReference and Reference existed both in WeakAction ? They don't reference the same object?

Sorry maybe this is a stupid question, but from the definition of WeakReference, i really didn't understand the different between ActionReference and Reference

Thanks
Coordinator
Mar 27 at 10:36 AM
Hi,

Most of the time it is the same object. But there is a possibility that a user defines a Reference for lifetime management of the recipient, and that the method is defined in another object, or that it is static.

Cheers
Laurent
Mar 27 at 11:20 AM
Edited Mar 27 at 11:22 AM
Hi Laurent

I looked up the Messengers.cs. in where the constructor WeakAction(object target, Action<T> action) is used.
Here target is a recipient, it is not a target of action.

:)

Thanks a lot
Comiscience