I build a project with mvvmlight. Using Messenger send message between VMs or VM and View. Now, I wonder that when and where to unregister messenger. Could u help me?
Edited:
This is my scene:
There are a MainWindow and a ChildWindow, the ChildWindow (include a ContentControl consist of one of two different UserControl), change the ContenControl via a SwitchButton in ChildWindow. Every window or UserControl corresponding to a ViewModel.

MainViewModelsends a message toMainWindowto open theChildWindow;MainWindowopens theChildWindow(firstly useUserControlView1, don't useUserControlView2), and send a message toUserControl1ViewModeldo something;- If user click the CancelButton,
ChildWindowViewModelsends a message toChildWindowto close; - If
ChildWindowViewModelfireUnloadedCommand,ChildWindowsends a message to each ofUserControlViewmodelto clean up something.
The operation of register and unregister messenger put in the constructor and the destructor of the View or the ViewModel, or put in the LoadedCommand and UnloadedCommand's delegate methods? View's Loaded and Unloaded's command binding to LoadedCommand and UnloadedCommand.