title: C# UWP can't display usercontrol with code
body: <p>I made an Usercontrol with C# UWP, so if i create my Usercontrol with Xaml in my MainPage.Xaml I can see it.
  But if I create it in my MainPage.xaml.cs with C# code i can't see it. I think i forgot something in MainPage.xaml.cs when I create my control.</p>
  <p>I would be happy if someone have a solution for my problem :D</p>
  <p>MyControl.xaml:</p>
  <pre><code>&lt;UserControl
      x:Class=&quot;CustomControlTest.MyControl&quot;
      xmlns=&quot;http://schemas.microsoft.com/winfx/2006/xaml/presentation&quot;
      xmlns:x=&quot;http://schemas.microsoft.com/winfx/2006/xaml&quot;
      xmlns:local=&quot;using:CustomControlTest&quot;
      xmlns:d=&quot;http://schemas.microsoft.com/expression/blend/2008&quot;
      xmlns:mc=&quot;http://schemas.openxmlformats.org/markup-compatibility/2006&quot;
      mc:Ignorable=&quot;d&quot; Height=&quot;32.06&quot; Width=&quot;53.254&quot;&gt;
  
      &lt;Grid&gt;
          &lt;Button Content=&quot;Hello&quot; Background=&quot;Green&quot; HorizontalAlignment=&quot;Left&quot; Margin=&quot;0,0,0,0&quot; VerticalAlignment=&quot;Top&quot;/&gt;
      &lt;/Grid&gt;
  &lt;/UserControl&gt;
  </code></pre>
  <p>MyControl.xaml.cs:</p>
  <pre><code>namespace CustomControlTest
  {
      public sealed partial class MyControl : UserControl
      {
          public MyControl()
          {
              this.InitializeComponent();
          }
      }
  }
  </code></pre>
  <p>MainPage.xaml:</p>
  <pre><code>&lt;Page
      x:Class=&quot;CustomControlTest.MainPage&quot;
      xmlns=&quot;http://schemas.microsoft.com/winfx/2006/xaml/presentation&quot;
      xmlns:x=&quot;http://schemas.microsoft.com/winfx/2006/xaml&quot;
      xmlns:local=&quot;using:CustomControlTest&quot;
      xmlns:d=&quot;http://schemas.microsoft.com/expression/blend/2008&quot;
      xmlns:mc=&quot;http://schemas.openxmlformats.org/markup-compatibility/2006&quot;
      mc:Ignorable=&quot;d&quot;
      Background=&quot;{ThemeResource ApplicationPageBackgroundThemeBrush}&quot;&gt;
  
      &lt;Grid&gt;
          &lt;!--&lt;local:MyControl/&gt;--&gt;
      &lt;/Grid&gt;
  &lt;/Page&gt;
  </code></pre>
  <p>MainPage.xaml.cs:</p>
  <pre><code>namespace CustomControlTest
  {
      public sealed partial class MainPage : Page
      {
          public MainPage()
          {
              this.InitializeComponent();
  
              MyControl mc = new MyControl();
              mc.HorizontalAlignment = HorizontalAlignment.Stretch;
              mc.VerticalAlignment = VerticalAlignment.Stretch;
          }
      }
  }
  </code></pre>