Hi, since nice circles example i was wondering if anyone wants to propose a solution for an Message system in VL, since this is quite common case to run something somewhere when something happens the workflow for C# looks like so:
Let’s say we have some message class with some random properties:
public sealed class LoginCompletedMessage {
public string username { get; set; }
}
now we can have a delegate subscriber in some random spot in our app:
Messenger.Default.Register<LoginCompletedMessage>(this, (r, m) =>
{
// Handle the message here...
});
and obviously we have some operation to send this message:
Messenger.Default.Send(new LoginCompletedMessage() {username: "antokhio"});
Unregister:
Messanger.Default.Unregister<LoginCompletedMessage>(this)
or
Messanger.Default.UnregisterAll(this)
reference: