I have an MVVM project using Catel and am using the GetService method on the ViewModelBase class to instantiate views and message boxes from my view model classes. I am seeing some strange behavior when using the IUIVisualizerService and IMessageService
to show modal windows and dialogs.
For example, I have my main window that has a command that opens a window for a view model (we'll call it Window A) by getting an instance of the IUIVisualizerService and then calling the ShowDialog method and passing in the view model for
Window A. Window A is displayed as expected. So far so good.
Now I have a command on Window A that opens Window B also by calling ShowDialog on an IUIVisualizer instance. When ShowDialog executes, Window B is shown but Window A is hidden (or maybe just pushed to the background). Why is that? In typical
Windows programming Window A would be left open and visible on top of the main window in this scenario and Window B would be open and visible on top of Window A.
When Window B is closed, then Window A becomes visible again (or is brought back to the foreground).
The problem I'm having is if I use the IMessageService in this scenario to open a message dialog from Window A to prompt the user for input, Window A is hidden when the message dialog is open, but when the message dialog closes, Window A is not shown
again like when Window B closes but remains in the background. In this scenario the user is forced to click in the task bar to get back to Window A which is undesirable.
Is this a bug or by design?