Using Prism 6 Event Aggregator between view models with an object as the payload

烈酒焚心 提交于 2019-12-06 15:35:08

Your problem is simple: You are defining the event to pass an object as payload, then trying to use a specific class as payload instead. To fix this, change

internal class OrderSelectedEvent : PubSubEvent<object>

To:

internal class OrderSelectedEvent : PubSubEvent<OrderSelectedPayload>

Alternatively, you could change your handler signature to match the expected parameters of the event:

private void OrderSelectedEventHandler(OrderSelectedEvent.OrderSelectedPayload ospl)

To:

private void OrderSelectedEventHandler(object ospl)
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!