This project has moved and is read-only. For the latest updates, please go here.

Any reason for not using WeakReferences in NotificationManager?

Jan 11, 2012 at 9:58 PM

Have you considered that at all? Are there negative performance implications if you do? Was it just not done to save time? It seems like both Prism and MVVM Light use these in their pub/sub implementations...

Jan 13, 2012 at 12:26 AM

Hi, yes, the code even says:

   // CONSIDER: Make this hold weak refs?
   private Dictionary<object, List<Action<object, object>>> _messages = new Dictionary<object, List<Action<object, object>>>();

So, I definitely considered it, it was just an incomplete item.  I'll can add it.

Jan 13, 2012 at 12:28 AM

Cool, thanks. It just seemed like a bug and I was wondering if I understand it correctly.

Jan 20, 2012 at 10:55 PM

I've just addressed this with a checkin, let me know if you have further questions.