Hello! Suppose there are two views. View1 appears when the form is loaded, and View2 by clicking on the button. How can I make it so that when View2 View1 disappears? At the moment I have View2, but View1 remains to hang and appear through View2 
Views are bind as follows: MainWindow.xaml
<Window.Resources> <DataTemplate x:Name="v1" DataType="{x:Type viewmodels:View1ViewModel}"> <views:View1 DataContext="{Binding}"/> </DataTemplate> <DataTemplate x:Name="v2" DataType="{x:Type viewmodels:View2ViewModel}"> <views:View2 DataContext="{Binding}"/> </DataTemplate> </Window.Resources> <Grid> <ContentControl Content="{Binding}"/> </Grid> View1 is bound
<ContentControl Content="{Binding View2}"/> By pressing the button the command is triggered.
private RelayCommand showView2; public RelayCommand ShowView2 { get { return showView2 ?? (showView2= new RelayCommand(obj => { View2Form = new View2ViewModel(); })); } } View2 property to be displayed
private object view2Form; public object View2Form { get { return view2Form; } set { if (Equals(view2Form, value)) return; view2Form= value; OnPropertyChanged("View2Form"); } } 