I have few basic views in my WPF app, but I don’t want to design in visual way one of them and other programmatically.
What’s the best approach way to design few forms and programmatically only exchange them within the main window?
EDIT: of course, I don’t want to close/open new windows 😉
Usually I have a
ShellViewModelcontaining theCurrentViewModel, and display the CurrentViewModel as aContentControlthe ShellView. Then to switch pages, all you do is change theCurrentViewModelproperty in theShellViewModelShellView:
ShellViewModel:
You can see an example of it here