The problem is probably that the message is sent before the DetailViewModel is created, and consecuently the message registered.
You can check if this is the behavior by setting breakpoints on both, sending and receiving the message. If the message is sent but not received, that's probably the scenario.
Onew way to solve this, is by forcing the app to create the DetailViewModel
at the beginning of the execution, instead of waiting until the first time it is used.
For that, go to your ViewModelLocator.cs file and in the command where you register the DetailViewModel
, add true
parameter. That is, replace:
SimpleIoc.Default.Register<DetailViewModel>();
with:
SimpleIoc.Default.Register<DetailViewModel>(true);
This will force the DetailViewModel to be created immediately, and therefore the message will be registered.