title: How do I add a textblock dynamically to a page?
body: <p>I'm just learning how to make universal apps for windows 10. Most of the tutorials show you how to work with XAML and how to assign functions to elements when you click on them but I couldn't find a way to make a new control appear when I click a button. </p>
  
  <p>I'm making a note taking application. I've designed most of the stuff that I need. Now I want whenever I click a button to create a new textblock where the user can write their note.</p>
  
  <pre><code>    //Create a new note when clicking the add button
      private void newNoteBtn_Click(object sender, RoutedEventArgs e)
      {
  
          TextBox newNote = new TextBox();
          newNote.Text = "Enter your text";
      }
  </code></pre>
  
  <p>This is the code that runs when the button is clicked. When I run the application nothing happens. I think I have to put the new textbox in some kind of <code>Grid</code> or something.</p>
  
  <p>Most of the tutorials are really old or mention windows forms and use some sort of <code>this.Controls.Add(newNote);</code> but Visual studio doesn't give me the Controls.Add option. I've also created a <code>&lt;Grid x:Name="notes"&gt;&lt;/Grid&gt;</code> which I thought I could use as a placeholder for the notes that are being created but I can't access the <code>Grid</code> element through the code.</p>