0

鉴于这种:

var msg = new NotificationMessage<bool>(isHead, buffer.ToString());

Messenger.Default.Send<NotificationMessage<bool>>(msg);

我如何捕捉到这条消息?

我不确定 Messenger.Default.Register... 语法,

或操作方法的原型。

谢谢

4

1 回答 1

1

D'oh, here it is:

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

private void MessageRx(NotificationMessage<bool> msg)

msg.Notification is the message string, and msg.Content is the value of the bool.

于 2012-07-17T15:21:52.590 回答