2

I am using the mvvm light toolkit for a project and I used to explicitly unregister to all the types of messages each instance was registered to, like this:

Messenger.Default.Unregister<MessageType1>(this);
Messenger.Default.Unregister<MessageType2>(this);
...

But is this

Messenger.Default.Unregister(this);

giving me the same result if I want to unregister to everything ? (for example in the Cleanup method of a ViewModel) I would assume so, but I did not find any hard evidence that my assumption was right.

Thanks!

matfillion
  • 867
  • 6
  • 10

1 Answers1

4

I browsed the source code for a moment, and it does appear that Messenger.Default.Unregister(this) will unregister the target object from any actions it registered previously.

Joel B Fant
  • 24,406
  • 4
  • 66
  • 67