I’m very much new in WPF & MVVM paradigm and i’m trying hard to absorb it. The problem i’m having looks like a lot of MVVM beginers face the same & it seems there’s no simple approach. So, to keep the problem domain simple here’s just an experimental work.
I have a MainWindow with a “New” button on it. I want to show an instance of a NewWindow.xaml when i click on this button. How can i do this from MainWindowViewModel? Can mediator pattern help? Please suggest any good implementation reference.
I also have a “Close” button on the MainWindow & i want to exit the application when i click this one. And I need help again 🙁
i did have the same problem a while ago.
at least i use a very simple approach and i’m happy with. here is my solution.
in your viewmodel you just have to write one line of code: