I'm having some problems using the Messenger. I have a View and ViewModel. When the View is created it registers for Message A. When the View Model receives a particular command a notification of Message A is sent by the View Model, and the View creates
a new dialog.
The problem comes when the View is reopened (after being closed down). When the View is reopened it once again registers for Message A. But now when the View Model receives a particular command and a notification is sent by the View model, there are
two actions. The new action is fine and is the desired one, but the old action (from the first time the View was created) is a problem because its target, the original View, is awaiting garbage collection and so invoking the action causes unwanted results.
The check in Messenger to ascertain whether the action's target is dead does not help in this situation because the target is awaiting garbage collection, but has yet to be garbage collected.
Is there a way to overcome this issue short of (a) implementing Unregister on Messenger, or (b) limiting message-action mapping to one action with a given signature for each message?