title: How do I add UI Children to an empty WPF-Page?
body: <p>I'm having a MainWindow which is a NavigationWindow. Inside this MainWindow I want to switch in several Pages. One of the Pages has to be dynamically generated by Code, not by XAML. When I had a normal window before, I could add UI components like this:</p>
  
  <pre><code>Button b = new Button();
  b.Content = "Hello";
  this.AddChild(b);
  </code></pre>
  
  <p>Or if I added (for example) a StackPanel with this method first, I could add Children to this StackPanel with:</p>
  
  <pre><code>myPanel.Children.Add(b);
  </code></pre>
  
  <p>However, <strong>the Page Class doesn't have a Children Attribute or a AddChild Method.</strong>
  The only method I found so far is:</p>
  
  <pre><code>AddVisualChild(b);
  </code></pre>
  
  <p>The page shows but I don't see any components which I added with this method.
  So how do I add Children to a WPF-Page correctly?</p>