Does mvvm light v3 unregister work properly?

You should modify the call to Unregister to pass in the recipient object, not the message type:


If you look at the MVVM Light code for the messenger all unregister actions use the recipient - as internally the recipient is used for identifying which message handlers will be removed. The most basic method is Unregister(recipient), which de-registers all actions for a given recipient. All additional parameters allow for a more fine grained approach.

If you have multiple actions handling the same message type and you want to unregister only one of them you can use

Messenger.Unregister<DialogMessage>(recipient, action);

to only remove one of the actions.


The MVVM Light release notes for V. 4 indicate the following changes to the Messenger:

  1. Missing methods where added to. The IMessenger interface.
  2. An additional Unregister method allowing to use tokens for filtering was added.
  3. The Messenger.CleanupList method was made thread safe.