I’m interested in creating an app that displays some buttons and changes a viewport according to the selected button. The viewport in my app is a ContentControl and I thought of changing its content whenever a button is clicked. However, I believe there’s a better approach, by perhaps injecting the ViewModels of each of the Views I want to present to the ContentControl and styling them using DataTemplates (Since I want to avoid having a grid with many controls and just setting their Visibility property whenever I want to show a particular view). Which of the approaches seems better to you? Do you have a different approach for this?
The view should be something similar to this:

Thanks!
Usually have a ViewModel behind the window which contains:
ObservableCollection<IViewModel> AvailableViewModelsIViewModel SelectedViewModelICommand SetCurrentViewModelCommandI display the
AvailableViewModelsusing anItemsControl, which has itsItemTemplateset to aButton. TheButton.Commandis bound to theSetCurrentViewModelCommand, and it passes the current data item from theAvailableViewModelscollection in through theCommandParameterTo display the content area, I use a
ContentControlwithContentControl.Contentbound toSelectedViewModel, andDataTemplatesget used to tell WPF how to render each ViewModel.The end result is my XAML looks something like this:
You can view an example of the full code used for such a setup on my blog