I have my ViewModel which has an ErrorCommand. I wish to subscribe to this in my view code behind so that any time it is called I can display an error message which is passed like so:
ErrorCommand.Exectute("Error occured")
In the view:
this.WhenAny(view => x.ViewModel.ErrorCommand, x => x.Value).Subscribe(error => DisplayError(error));
This code doesn't actually work but hopefully shows what I'm trying to acheive. How would I do this correctly?
I understand I could use the MessageBus, but I also have a similar scenario where the MessageBus wouldn't be appropriate.