开发者

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.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜