Unregister(this) unregisters this instance from everything?
I am using the mvvm light toolkit for a project and I used to explicitly unregister to all the types of messages each instanc开发者_开发百科e 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!
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.
精彩评论