Silverlight Prism Event Aggregator not reliable
I'm experiencing some reliability issues with Prism/Silverlight. I got couple of modules one publishing events and other subscribing.
Every time when I run the application from VS on debug mode by pressing "F5", the events are published and subscribed as expected. However, when I run the application from visual studio by pressing "Ctrl+F5", then the event publication/subscription is matter of luck. Sometime its working, sometimes its not working.
Anyone ex开发者_JS百科perienced this issue?
The most common cause I've seen for this issue is that the subscriber is being GCed. This blog post gives an explanation of why it could happen and provides a way to solve it.
Other than that, I can think of no other cause for this to happen.
I hope this helps.
Thanks, Damian
Usually this happens when you subscribe to events before their are published. Make sure that all your publishers are initialized first;
精彩评论