Messenger -"Register" an instance and not a type with the MVVM Light Toolkit?
- by vidalsasoon
Hello i'm consfused using the Messenger class of MVVM Light.
I have a ProductsViewModel that can get initialized a number of times.
In the constructor of ProductsViewModel I have this code:
Messenger.Default.Register(this, n = MessageBox.Show(n.Test));
The problem is, if I have 2 instances of ProductsViewModel, then Messenger gets registered twice.
Is is bad to Register the Messenger in a constructor?
Hope this makes sense!