I have problem to understand how to implement this with Caliburn Micro, event aggregator, i have a view model that call 2 different window, and before show, I subscribe to an handle of type string, it works, but now I want to know in the handle method, from which subscribe came the message:
public void Causale()
{
var asm = Assembly.LoadFrom(@"V.M.Tabelle.Magazzino.Causale.dll");
var module = _shell.LoadModule(asm);
if (module != null)
{
_eventAggregator.Subscribe(this);
module.Show("Add");
//_shell.CurrentView = (new ShellMenuItem { Caption = "Tiard", ScreenViewModel = module });
}
}
public void CausaleList()
{
var asm = Assembly.LoadFrom(@"V.M.Tabelle.Magazzino.Causale.dll");
var module = _shell.LoadModule(asm);
if (module != null)
{
_eventAggregator.Subscribe(this);
module.Show("List");
//_shell.CurrentView = (new ShellMenuItem { Caption = "Tiard", ScreenViewModel = module });
}
}
public void Handle(string message)
{
_eventAggregator.Unsubscribe(this);
BackValue = message;
NotifyOfPropertyChange(() => BackValue);
}
I've serached for a property, like subscribe(this).name("") to pass something like a token.
Thank you