I'm very new to MVVM light and im having some problems using the Messenger..
Im trying to send a message from the ViewModel to the View but this is not working for me, I have tried going through posts and sample code but i think there is something very simple that i am missing.. i appreciate your help..
In my ViewModel I send a message
Messenger.Default.Send(new ClearNewProjectSettingsMessage());
This is my Message class, I dont really know what to put here because everything is in my View class
public class ClearNewProjectSettingsMessage
{
public ClearNewProjectSettingsMessage()
{
}
}
I register the message in the Views constructor:
Messenger.Default.Register<ClearNewProjectSettingsMessage>(
this,
() => ClearSettings()
);
This unfortunately does not compile so I tried this:
Messenger.Default.Register<ClearNewProjectSettingsMessage>(this,ClearSettings);
But it still does not work..
This is the method i want to call (in the view):
private void ClearSettings()
{
passwordBox.Clear();
}
Thanks.