I am using MVVM Light to send a message between two ViewModels. In the host virtual machine, I am trying to do the following
Messenger.Default.Register<NotificationMessage>(this, async (msg) => {
await HandleMessage(msg);
});
private async Task HandleMessage(NoficationMessage message)
{
... code using await
}
The first time a message is sent (by pressing a button), the asynchronous method is executed. The next time the message is sent, nothing happens - the method is not called (it is checked through a breakpoint).
Asynchronously valid for the Register method this way?
What will be the workaround?
source
share