Does Prism EventAggregator support hot subscription?

35 views Asked by At

I am looking to use Prism EventAggregator to communicate between 2 different views and with basic implementation the event publish / subscribe is working fine. The problem is that Subsribe doesn't receive the initial Publish (so its not really a hot observable) that was done before the new view is initialised. I am looking to make EventAggregator have 'hot observable' and all new Subscription receive the last published event data.

1

There are 1 answers

0
mm8 On

Does Prism EventAggregator support hot subscription?

Short answer: No, at least not using the built-in implementation. The subscriber is expected to subscribe before any event is published by the publisher.

But you could implement this yourself by overriding the Publish and Subscribe methods of the PubSubEvent or EventBase classes to "cache" the event being published.

You'll find the default implementation on GitHub.