Well, basically it depends on how your application looks (that is, how many windows are open at the same time, modal windows or not ... etc.).
The general recommendation that I would give is not to try to make a “clean” MVVM; I often read things like "there must be a ZERO code" ... etc., I do not agree.
Currently, I am separating my project from the assembly / project of the model, ViewModel assembly / project and view assembly / project. If this happens in another, "Core" assembly?
ViewModels - , , -, Model. .
ViewModel , , . , WCF- .
"Core" (IMHO), , , (, ... ..).
( ... ..), , . ViewModels . ViewModels, , , .
, MainWindow, , :
public MainViewModel : ViewModelBase
{
...
public event EventHandler<EventArgs<MyPopupViewModel>> ConfirmationRequested;
...
public void DoSomething()
{
if (this.ConfirmationRequested != null)
{
var vm = new MyPopupViewModel
{
};
this.ConfirmationRequested(this, new EventArgs<MyPopupViewModel>(vm));
}
}
}
...
public partial class MainWindow : Window
{
public public MainWindow()
{
this.InitializeComponent();
this.ViewModel = new MainViewModel();
this.ViewModel.ConfirmationRequested += (sender, e) =>
{
var myPopup = new PopupWindow(e.EventArgsData);
myPopup.Show();
};
}
public MainViewModel ViewModel { get; private set; }
}
<Application x:Class="XXX.App"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
...
StartupUri="Views/MainWindow.xaml">