I have a Window on which I load an UserControl say Control1. Now if the user clicks on a certain button a new UserControl, Control2 should be loaded on the Window and Control1 s
Rachel's comment helped me to find the solution.
Put a ContentPresenter in the MainWindow like this:
<ContentPresenter Content="{Binding ActiveWidget}"/>
and then in the ViewModel
public ViewModelBase ActiveWidget {get;set;} // Don't forget INotifyPropertyChanged!!
then you must create a DataTemplate
for each ViewModel
with an appropiate instance of the UserControl
s. See This Article for a generic solution to this.