title: I need to open an Usercontrol in the main Window from another Usercontrol
body: <p>Basically I have this Usercontrol, which is a main menu, with a new game button, a load button, and a setting button. 
  I need this to open when I start it up, but more importantly when hit new game button I need the main menu to be replaced with another usercontrol. 
  I have been trying and look up stuff for hours and have not worked out how to yet, so I hope someone can tell me what I have been doing wrong. Here is my current code.</p>
  
  <p>I've still very much a beginner at programming and using this as a way to get bigger, so sorry if I seem slow.</p>
  
  <p>MainWindow XAML:</p>
  
  <pre><code>&lt;Window.Resources&gt;
      &lt;DataTemplate DataType="{x:Type local:MainInterfaceViewModel}"&gt;
          &lt;local:MainInterface/&gt;
      &lt;/DataTemplate&gt;
      &lt;DataTemplate DataType="{x:Type local:Character_CreationViewModel}"&gt;
          &lt;local:Character_Creation/&gt;
      &lt;/DataTemplate&gt;
  &lt;/Window.Resources&gt;
  &lt;Window.Background&gt;
      &lt;ImageBrush ImageSource="pack://application:,,,/Pokemorph Island;component/images/cover1.jpg"/&gt;
  &lt;/Window.Background&gt;
  &lt;Grid&gt;
      &lt;Grid.RowDefinitions&gt;
          &lt;RowDefinition Height="535*"/&gt;
          &lt;RowDefinition Height="36*"/&gt;
      &lt;/Grid.RowDefinitions&gt;
      &lt;Grid.ColumnDefinitions&gt;
          &lt;ColumnDefinition Width="90*"/&gt;
          &lt;ColumnDefinition Width="307*"/&gt;
      &lt;/Grid.ColumnDefinitions&gt;
      &lt;DockPanel Grid.ColumnSpan="2" Grid.RowSpan="2"&gt;
          &lt;ContentControl x:Name="FullScreen" DockPanel.Dock="Right" Content="{Binding SelectedViewModel}"/&gt;
      &lt;/DockPanel&gt;
      &lt;DockPanel Grid.Column="0" Grid.RowSpan="2"&gt;
          &lt;ContentControl x:Name="User" /&gt;
      &lt;/DockPanel&gt;
      &lt;Button Content="&amp;gt;&amp;gt;&amp;gt;" HorizontalAlignment="Left" Click="Change_Image_UP" Style="{StaticResource RoundCorner}" Margin="66,0,0,0" VerticalAlignment="Top" Width="51" Height="31" Foreground="White" FontSize="16" FontWeight="Bold" FontFamily="Rockwell Extra Bold" Grid.Row="1"/&gt;
      &lt;Button Content="&amp;lt;&amp;lt;&amp;lt;" HorizontalAlignment="Left" Click="Change_Image_Down" Style="{StaticResource RoundCorner}" Margin="10,0,0,0" VerticalAlignment="Top" Width="51" Height="31" Foreground="White" FontSize="16" FontWeight="Bold" FontFamily="Rockwell Extra Bold" Grid.Row="1"/&gt;
      &lt;Button Content="Image Source" HorizontalAlignment="Left" Click="Image_Source" Style="{StaticResource RoundCorner}" Margin="431,0,0,0" VerticalAlignment="Top" Width="84" Height="31" Foreground="White" Grid.Column="1" Grid.Row="1"/&gt;
      &lt;Button Content="PATREON" HorizontalAlignment="Left" Click="Patreon_Link" Style="{StaticResource RoundCorner}" Margin="520,0,0,0" VerticalAlignment="Top" Width="84" Height="31" Foreground="White" Grid.Column="1" Grid.Row="1"/&gt;
      &lt;Button Content="Button" Margin="0,507,0,0" VerticalAlignment="Top" Width="75" Command="{Binding MainCommand}"/&gt;
      &lt;Button Content="Button" Margin="134,507,584,0" VerticalAlignment="Top" Width="75" Command="{Binding CharCreaCommand}" Grid.ColumnSpan="2"/&gt;
  
  
  &lt;/Grid&gt;
  </code></pre>
  
  <p></p>
  
  <p>MainWindow Code</p>
  
  <pre><code>public partial class MainWindow : Window
  {
      int cover = 1;
  
      public MainWindow()
      {
          InitializeComponent();
          this.DataContext = new NavigationViewModel();
          //FullScreen.Content = new MainInterface();
      }
  
      private void Image_Source(object sender, RoutedEventArgs e)
      {
          if (cover == 1)
              System.Diagnostics.Process.Start("---------");
          if (cover == 2)
              System.Diagnostics.Process.Start("---------");
      }
      private void Change_Image_UP(object sender, RoutedEventArgs e)
      {
          cover = cover + 1;
          if (cover &gt; 2)
              cover = 1;
          if (cover == 1)
          {
              this.Background = new ImageBrush(new BitmapImage(new Uri(@"pack://application:,,,/Pokemorph Island;component/images/cover1.jpg", UriKind.Absolute)));
          }
          else if (cover == 2)
          {
              this.Background = new ImageBrush(new BitmapImage(new Uri(@"pack://application:,,,/Pokemorph Island;component/images/cover2.png", UriKind.Absolute)));
          }
      }
      private void Change_Image_Down(object sender, RoutedEventArgs e)
      {
          cover = cover - 1;
          if (cover &lt; 1)
              cover = 2;
          if (cover == 1)
          {
              this.Background = new ImageBrush(new BitmapImage(new Uri(@"pack://application:,,,/Pokemorph Island;component/images/cover1.jpg", UriKind.Absolute)));
          }
          else if (cover == 2)
          {
              this.Background = new ImageBrush(new BitmapImage(new Uri(@"pack://application:,,,/Pokemorph Island;component/images/cover2.png", UriKind.Absolute)));
          }
      }
      private void Patreon_Link(object sender, RoutedEventArgs e)
      {
          System.Diagnostics.Process.Start("https://www.patreon.com/user?u=3253293");
      }
  }
  </code></pre>
  
  <p>Mainmenu Usercontrol</p>
  
  <pre><code>&lt;Grid&gt;
      &lt;Button Content="New Game" HorizontalAlignment="Left" Style="{StaticResource RoundCorner}" Margin="10,10,0,0" VerticalAlignment="Top" Width="138" Height="76" Background="#338B0000" Foreground="White" FontFamily="Segoe Print" FontSize="24" FontWeight="Bold" Command="{Binding CharCreaCommand}" CommandParameter="CharCrea"/&gt;
      &lt;Button Content="Load Game" HorizontalAlignment="Left" Style="{StaticResource RoundCorner}" Margin="10,91,0,0" VerticalAlignment="Top" Width="138" Height="76" Background="#338B0000" Foreground="White" FontFamily="Segoe Print" FontSize="24"/&gt;
      &lt;Label Content="Pokémorph Island" HorizontalAlignment="Left" Margin="103,313,0,0" VerticalAlignment="Top" Height="111" Width="616" Foreground="#CCFF00C5" FontWeight="Bold" FontFamily="Rage Italic" FontSize="80"/&gt;
      &lt;Button Content="Settings" HorizontalAlignment="Left" Style="{StaticResource RoundCorner}" Margin="10,172,0,0" VerticalAlignment="Top" Width="138" Height="76" Background="#338B0000" Foreground="White" FontFamily="Segoe Print" FontSize="24"/&gt;
  &lt;/Grid&gt;
  </code></pre>
  
  <p>The Current MVVM I've been trying to use</p>
  
  <pre><code>class NavigationViewModel : INotifyPropertyChanged
  {
      public ICommand MainCommand { get; set; }
  
      public ICommand CharCreaCommand { get; set; }
  
      private object selectedViewModel;
  
      public object SelectedViewModel
      {
          get { return selectedViewModel; }
  
          set { selectedViewModel = value; OnPropertyChanged("SelectedViewModel"); }
      }
  
      public NavigationViewModel()
      {
          MainCommand = new BaseCommand(OpenMain);
  
          CharCreaCommand = new BaseCommand(OpenCharCrea);
      }
  
      private void OpenMain(object obj)
      {
          SelectedViewModel = new MainInterfaceViewModel();
      }
  
      private void OpenCharCrea(object obj)
      {
          SelectedViewModel = new Character_CreationViewModel();
      }
  
      public event PropertyChangedEventHandler PropertyChanged;
  
      private void OnPropertyChanged(string propName)
      {
          if (PropertyChanged != null)
          {
              PropertyChanged(this, new PropertyChangedEventArgs(propName));
          }
      }
  }
  
  public class BaseCommand : ICommand
  {
      private Predicate&lt;object&gt; _canExecute;
      private Action&lt;object&gt; _method;
      public event EventHandler CanExecuteChanged;
  
      public BaseCommand(Action&lt;object&gt; method)
          : this(method, null)
      {
      }
  
      public BaseCommand(Action&lt;object&gt; method, Predicate&lt;object&gt; canExecute)
      {
          _method = method;
          _canExecute = canExecute;
      }
  
      public bool CanExecute(object parameter)
      {
          if (_canExecute == null)
          {
              return true;
          }
  
          return _canExecute(parameter);
      }
  
      public void Execute(object parameter)
      {
          _method.Invoke(parameter);
      }
  }
  </code></pre>