Is there an example implementation of weak events using .NET's WeakEventManager?
I'm trying to implement it by following the "Notes to Inheritors" in the documentation, but it is vague. For example, I can't figure out how to call ProtectedAddListener
from my static AddListener
function in my custom manager.
I figured it out on my own following the guidelines in the "Notes for Inheritors" section of the WeakEventManager documentation. Here's a basic implementation of
WeakEventManager
. The class sourcing the event is namedPropertyValue
and the event is namedChanged
.