|
Hi,
Based on my understanding, the implementation details of the features you are describing will depend mostly of your personal preferences and the requirement of your scenario.
A possible approach could be to create a shared service that could receive the messages for each background thread. This could be done, for example, by making the
service subscribe to an event in each thread: when the thread want to publish a message, its event could be raise and it would be handled by the service. As you can define your own
payload type for the event, you could, for example, create a
payload that could store the message you want to publish and its priority. When the event is raised, the service would receive this information and apply the required logic in the messages to shown them.
For example, if you wish to show the message with the higher priority, you could store the messages published by the threads in a collection inside the service and each time this collection changes you could iterate through it to find the message with the
higher priority and show it.
You can find more information about shared services and event aggregation in the following chapter of the prism documentation:
I hope you find this useful,
Damian Cherubini
http://blogs.southworks.net/dcherubini
|