I\'m using a Messenger class in order to send data between view models. There is an AppView that hosts two main views in a content control, and up until now hav
You could solve the problem a few ways:
ShowDialog(). Use Show(), and make the dialog window TopMost and parented to the main window.Register the ProductView in the constructor of the DialogService (do you really need a new ProductView each time anyway?)
Make the DialogService (or a utility class inside of it) register at construction time for the message, and then pass the message on to any displayed ProductViews
Personally I like #2- since you are using ShowDialog, it implies that only one ProductView is ever needed at a time. For example:
class DialogService : IDialogService
{
Window productView = null;
ProductView _productView;
public DialogService()
{
_productView = new ProductView();
}
public void ShowDetailDialog()
{
_productView.ShowDialog();
}
}