Prism-EventAggregator: Event without payload?

Topics: Prism v2 - Silverlight 2, Prism v2 - Silverlight 3
Sep 16, 2009 at 2:25 PM

Hi,

I'd like to define an event without a payload, because I'd like to subscribe it with a method without input parameters.

Is it possible?

How could I do?

Thank you

Sep 18, 2009 at 10:06 PM

Hi

There is no out-of-the-box way to achieve this kind of functionality in Prism. The simple workaround is firing an event with a payload that means nothing (make it an object an always send null).

If you definitely require that the event is sent without a payload, you could have a class inherit from EventBase and make a copy most code from CompositePresentationEvent<T>, but make it non-generic. Take into account that it is not the only class you will have to modify, as some other classes depend on the generic payload.

Please let me know if this helps.

Damian Schenkelman
http://blogs.southworks.net/dschenkelman

 

Jan 22, 2014 at 12:47 PM
There's an EmptyPresentationEvent using the Facade pattern, which might be easier to implement:

http://stackoverflow.com/a/15431377/283787