开发者

Problem with sending message with parameter in mvvm light toolkit

开发者 https://www.devze.com 2023-04-02 06:51 出处:网络
I\'ve registered two messages: Messenger.Default.Register<NotificationMessage<DriverEventItem>>(this, NotificationMessageReceived);

I've registered two messages:

  Messenger.Default.Register<NotificationMessage<DriverEventItem>>(this, NotificationMessageReceived);

Messenger.Default.Register<NotificationMessage>(this,NotificationMessageReceived);

and I have two methods to handle this message:

private void NotificationMessageReceived(NotificationMessage<DriverEventItem> msg)
{
//so开发者_JAVA百科mething
}

private void NotificationMessageReceived(NotificationMessage msg)
{
//something
}

but this

var nm=new NotificationMessage(this.SelectedShowroomLog.DriverEventItem,"ShowView2");

Messenger.Default.Send(nm);

invokes me the second handler.

What should I do to correctly send this driveritem to a recipient?


It was simply :)

NotificationMessage(this.SelectedShowroomLog.DriverEventItem,"ShowView2")

0

精彩评论

暂无评论...
验证码 换一张
取 消