title: How to get my View set in the Content Presenter
body: <p>I'm currently working on a database-based application for work and I am struggling with connecting the ViewModel methods to my view. Here is what I've got so far:</p>
  <pre class="lang-cs prettyprint-override"><code>public class MainViewModel : BaseViewModel
  {
      public ICommand SwitchViewsCommand { get; private set; }
      public MainViewModel()
      {
          SwitchViewsCommand = new RelayCommand((parameter) =&gt; CurrentView = (UserControl)Activator.CreateInstance(parameter as Type));
      }
      private UserControl _currentView;
      public UserControl CurrentView
      {
          get
          {
              return _currentView;
          }
          set
          {
              if (value != _currentView)
              {
                  _currentView = value;
                  OnPropertyChanged(&quot;CurrentView&quot;);
              }
          }
      }
  }
  </code></pre>
  <p>This is my MainViewModel and following my Xaml-Code</p>
  <pre><code>&lt;Window x:Class=&quot;sKillPase.View.MainWindow&quot;
      xmlns=&quot;http://schemas.microsoft.com/winfx/2006/xaml/presentation&quot;
      xmlns:d=&quot;http://schemas.microsoft.com/expression/blend/2008&quot;
      xmlns:x=&quot;http://schemas.microsoft.com/winfx/2006/xaml&quot;
      xmlns:mc=&quot;http://schemas.openxmlformats.org/markup-compatibility/2006&quot;
      xmlns:viewmodels=&quot;clr-namespace:sKillPase.Core.ViewModels;assembly=sKillPase.Core&quot; xmlns:view=&quot;clr-namespace:sKillPase.View&quot;
      xmlns:local=&quot;clr-namespace:sKillPase.View&quot;
      d:DataContext=&quot;{d:DesignInstance Type=viewmodels:MainViewModel}&quot;
      mc:Ignorable=&quot;d&quot;
      Title=&quot;MainWindow&quot; Height=&quot;800&quot; Width=&quot;1200&quot;&gt;
  &lt;Grid &gt;
      &lt;Grid.ColumnDefinitions&gt;
          &lt;ColumnDefinition Width=&quot;150&quot; /&gt;
          &lt;ColumnDefinition Width=&quot;*&quot; /&gt;
      &lt;/Grid.ColumnDefinitions&gt;
      &lt;Grid.RowDefinitions&gt;
          &lt;RowDefinition Height=&quot;80&quot; /&gt;
          &lt;RowDefinition Height=&quot;*&quot; /&gt;
          &lt;RowDefinition Height=&quot;20&quot; /&gt;
      &lt;/Grid.RowDefinitions&gt;
      &lt;Border x:Name=&quot;Top&quot; Grid.Column=&quot;0&quot; Grid.ColumnSpan=&quot;2&quot; Background=&quot;Black&quot; &gt;&lt;/Border&gt;
      &lt;Border x:Name=&quot;Buttons&quot; Grid.Row=&quot;1&quot; Grid.RowSpan=&quot;2&quot; Background=&quot;Black&quot;&gt;&lt;/Border&gt;
      &lt;Border x:Name=&quot;Content&quot; Grid.Row=&quot;1&quot; Grid.Column=&quot;1&quot; Background=&quot;#FF303030&quot;&gt;&lt;/Border&gt;
      &lt;Border x:Name=&quot;Bottom&quot; Grid.Row=&quot;2&quot; Grid.Column=&quot;1&quot; Background=&quot;Black&quot;/&gt;
      &lt;ContentPresenter Grid.Row=&quot;1&quot; Grid.Column=&quot;1&quot; x:Name=&quot;ContentArea&quot; Content=&quot;{Binding CurrentView}&quot;/&gt;
      &lt;StackPanel x:Name=&quot;ButtonPanel&quot; Margin=&quot;5&quot; Grid.Row=&quot;1&quot;&gt;
          &lt;Button x:Name=&quot;Data&quot; 
                  Command=&quot;{Binding SwitchViewsCommand }&quot; 
                  CommandParameter=&quot;{x:Type local:DataView}&quot; 
                  &gt;
              Daten bearbeiten
          &lt;/Button&gt;
          &lt;Button x:Name=&quot;Report&quot;
                  Command=&quot;{Binding SwitchViewsCommand}&quot; 
                  CommandParameter=&quot;{x:Type viewmodels:ReportViewModel}&quot;
                  &gt;
              Report erstellen
          &lt;/Button&gt;
      &lt;/StackPanel&gt;
  
  
  &lt;/Grid&gt;
  </code></pre>
  
  <p>So my problem is, that if I compile the application, the Content Presenter doesn't show anything. It stays completely empty. So what can I do to add the different views (which I declared as User Controls) to my Content Presenter, by pressing one of the two buttons?</p>
  <p>Furthermore, one of the views contains a data grid that shows the different tables of my database. So if I have to watch out for some problems regarding the database, please feel free to state.</p>
  <p>Thanks in advance :)</p>