The WindowsBase DLL defines the IWeakEventListener event with summary:
Provides event listening support for classes that expect to receive events through the WeakEvent pattern and a System.Windows.WeakEventManager.
This vague description doesn't describe what the 'WeakEvent pattern' actually is.
So, what is this pattern, why is it...
When using weak events as described here http://wekempf.spaces.live.com/blog/cns!D18C3EC06EA971CF!373.entry in a Windows.Forms application the WeakEventManager leaks WeakReference objects.
I think this is because without a WPF message loop the CleanupOperation is never executed, although ScheduleCleanup is called in WeakEventManager.Pro...
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.
...
When I use databinding in WPF, my target controls are listening for events on the binding source. For example, I may have a ListView listening for CollectionChanged events on a ObservableCollection.
If the lifetime of an event source is expected to exceed the lifetime of an event listener, there is a potential memory leak, and the weak ...