title: UWP Popup class bug
body: <p>I have created a simple notepad. I am unable to assign a User Control to the Child property of Popup. Every time I do it throws an exception of type System.ArgumentException. When I instantiate the User Control in code it works fine.</p>
  
  <p>User control is called WrapOptionsDialog.</p>
  
  <pre><code>&lt;Page.Resources&gt;
      &lt;local:WrapOptionsDialog x:Key="wrapOptionsDialog" /&gt;
  &lt;/Page.Resources&gt;
  
  &lt;Grid&gt;
      &lt;TextBox Name="txtbox"
               IsEnabled="False"
               FontSize="24"
               AcceptsReturn="True"
               TextWrapping="{Binding Source={StaticResource wrapOptionsDialog}, Path=TextWrapping, Mode=TwoWay}"/&gt;
  &lt;/Grid&gt;
  
  WrapOptionsDialog wrapOptionsDialog = this.Resources["wrapOptionsDialog"] as WrapOptionsDialog;
  
  // Create popup
  Popup popup = new Popup
  {
      Child = wrapOptionsDialog,
      IsLightDismissEnabled = true,
  };
  </code></pre>
  
  <p>Below in comment I'm going to link the actual project. Exception occurs after clicking on Wrap Option button. Please help.</p>