I thought that the whole point of the event aggregator pattern was to decouple listners from publishers. In a proper decoupled system, how does the publisher know if a message should be published on the UI thread, HTTP thread, of any other thread?
To me, it makes more sense that a listener should perform the marshaling is a certain thread is required. If an marshalAction isn't provided, one could assume the current thread of the listener (SynchronizationContext.Current.Post()).
WinRT has some application life cycle and presentation events that I would like to 'forward' to the system. Some of the events are processed by services (processes running on a background track) and others by the UI ViewModels. These events are published on the background thread and propagated to the rest of the application.
I haven't look into Windows 8 development that deep, so it's possible that the whole application is running on the UI thread, but for now I assume it's not..
↧