How can I open another view in WPF MVVM using click handlers and commands? (Is my solution reasonable?)
问题 I am writing a WPF application that has two windows. I have a MainWindowViewModel that holds two more view models: AllTagsViewModel and PlotViewModel . public AllTagsViewModel AllTagsViewModel { get; private set; } public PlotViewModel PlotViewModel { get; private set; } At the moment, I'm using this solution as a click handler in the main window: private void LaunchPlotWindow_OnClick(object sender, RoutedEventArgs e) { if (PlotWindow.GlobalInstanceCount == 0) { PlotWindow plotWindow = new