title: How do I call another page from current page in WPF?
body: <p>I have a simple system that provides switching between several pages. <code>MainWindow</code> has a few functions which are redirecting to a pages:</p>
  
  <p><em>Each other function is redirecting to another page.</em></p>
  
  <pre><code>private void BtnDebug_Click(object sender, RoutedEventArgs e)
  {
     FrContent.Content = new Page_Debug();
  }
  </code></pre>
  
  <p>This works great because all these functions are called from a <code>MainWindow</code>. I need to call them from a <code>Page</code> too, where system above doesn't work.</p>
  
  <p>This is a way I tried to do it with:</p>
  
  <pre><code>private readonly MainWindow _mainWindow = new MainWindow();
  
  private void BtnShowNotes_OnClick(object sender, RoutedEventArgs e)
  {
      _mainWindow.FrContent.Content = new Page_Notes();
  }
  </code></pre>
  
  <p>The problem is that it doesn't show any elements that are in XAML although it called <code>InitializeComponent()</code> function. Why it is not acting like a functions in <code>MainWindow</code>?</p>