I'm writing an application in MVVM with so far good results. But I am doing work in the ViewModel which raises an error, which I want to show to the user to let them know.
I can just do something like this in my ViewModel (VM):
MessageBox.Show(errorMessage);
or more likely something like:
new ErrorMessageWindow(errorMessage).ShowDialog()
so I can style it.
The problem is then I am creating a UI popup from the VM. I'm creating unit tests for the application which also pop up the window and stop running until it's manually closed.
Looking for a good approach.
I was considering raising an event in the VM - but since the View really has no knowledge of the VM or its properties I don't know how I would subscribe to it.
I'm not using any external Frameworks - I'd rather implement anything myself.