This project is read-only.


SubscriptionToken should implement IDisposable


This would make it substantially easier to unsubscribe. I just need to dispose the subscription.
All in all, I'd align the entire event aggregator with IObservable/IObserver, to make it future-proof to the Reactive Extensions. Implementing IDisposable is just one tiny bit of it.
Closed Oct 25, 2012 at 6:12 PM by DCherubini

As mentioned before, since Prism v4.1 the SubscriptionToken class implements the IDisposable interface. Hence, as this suggestion is already addressed, we are closing this work item.

For those who want the IDisposable pattern to be implemented in other parts of the Prism Library, you can vote or post your suggestion in the following work item:

Damian Cherubini


dcazzulino wrote Sep 9, 2010 at 4:25 AM

Since the SubscriptionToken is instantiated by the EventBase itself, nothing would prevent it from passing itself to the token, so that upon disposing the token, it would know which event to call Unsubscribe on.

This is the way Rx extensions do it already, and the intended usage of IObservable.Subscribe.

I'd strongly encourage the team to look for potential refactorings that will make event aggregator Rx-compatible and IObservable/IObserver-based. The current APIs look a little dated with what's coming out of Rx...

fantivero wrote Sep 16, 2010 at 4:07 AM

See more information related information to this in the following thread:

fantivero wrote Sep 24, 2010 at 4:11 PM

Other thread where Reactive Extensions is mentioned as an option:

DCherubini wrote Mar 8, 2012 at 7:05 PM


For those interested in this subject, you might find useful to know that since since Prism 4.1 release (, IDisposable was implemented in the SubscriptionToken class.

To make this implementation possible, an Action is passed when constructing the SubscriptionToken, which is basically the Unsubcribe method group in the EventBase. Hence, when disposing the SubscriptionToken, this action is executed, thus unsubscribing the event.


Damian Cherubini