MVVM Light Messenger executing multiple times

后端 未结 5 1779
不知归路
不知归路 2021-01-13 11:29

I am using MVVM Light and am using Messages to communicate between ViewModels to let a ViewModel know when it is ok to execute something. My problem is that I register for

5条回答
  •  天命终不由人
    2021-01-13 12:08

    As other contributors mentioned, the same message is being registered multiple times. I have noticed this behavior taking place while navigating to View X then navigating back to View Z where the message is registered in the constructor of the Z ViewModel. One solution is to set the NavigationCacheMode property to Required

    
    

提交回复
热议问题