This project has moved. For the latest updates, please go here.

Any reason for not using WeakReferences in NotificationManager?

Jan 11, 2012 at 8: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...

Coordinator
Jan 12, 2012 at 11:26 PM

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 12, 2012 at 11:28 PM

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

Coordinator
Jan 20, 2012 at 9:55 PM

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