title: I would like to add children to a template using get => ContentStack.Children; but this does not work properly
body: <p>I have a template frame that provides some padding and accepts multiple elements:</p>
  <pre><code>[Xamarin.Forms.ContentProperty(&quot;Contents&quot;)]
  public class ContentFrame : StackLayout
  {
      public StackLayout ContentStack = new StackLayout();
      public IList&lt;View&gt; Contents { get =&gt; ContentStack.Children; }
  
      public ContentFrame()
      {
          CustomFrame cf = new CustomFrame()
          {
              Content = ContentStack,
              HasShadow = false,
          };
          cf.SetDynamicResource(BackgroundColorProperty, &quot;ContentFrameBackgroundColor&quot;);
          cf.SetDynamicResource(Frame.CornerRadiusProperty, &quot;ContentFrameCornerRadius&quot;);
          cf.SetDynamicResource(MarginProperty, &quot;ContentFrameMargin&quot;);
          this.Children.Add(cf);
      }
  </code></pre>
  <p>I would like to add child labels like this: c1.Children.Add -  But when I do this the BackgroundColor, CornerRadius and Margin don't get used (see first part of image for ABC and ABC)</p>
  <p>The only way I can get it to use these is by exposing ContentStack as a public property and by adding to that (see below for ABC and GHI)</p>
  <pre><code>public class TestPage : HeadingView
  {
      public TestPage() : base()
      {
          var s = new Stack();
  
          var c1 = new ContentFrame();
          c1.Children.Add(new Label() { Text = &quot;ABC&quot; });
          c1.Children.Add(new Label() { Text = &quot;DEF&quot; });
  
          var c2 = new ContentFrame();
          c2.ContentStack.Children.Add(new Label() { Text = &quot;DEF&quot; });
          c2.ContentStack.Children.Add(new Label() { Text = &quot;GHI&quot; });
  
          s.Children.Add(c1);
          s.Children.Add(c2);
  
          this.InnerContent = s;
      }
  }
  </code></pre>
  <p><strong>Question &gt;</strong> Can anyone explain why the first case (with get =&gt; ContentStack.Children) doesn't show the frame background, radius etc.</p>
  <p><a href="https://i.stack.imgur.com/Olq5J.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Olq5J.png" alt="enter image description here" /></a></p>