title: Layout render error when using Tasks modifying controls
body: <h3>Description</h3>
  <p>Hello,</p>
  <p>Rendering of Layouts are not updated if they contains controls (ContentView) with some rendering Task !</p>
  <ol>
  <li>I created a simple ContentView which contains three Image (the FireControl in the screenshot).</li>
  <li>In the constructor, I use a simple async method, with Task.Factory.StartNew, which will play on the visibility of the Face images with a small Task.Delay between them.</li>
  <li>In the MainPage, I load this control in a StackLayout, using a button : &quot;Load control&quot;.</li>
  </ol>
  <ul>
  <li>It is impossible for me to add a second control (if I press again &quot;Load control&quot; )!</li>
  <li>It's like if the rendering of the StackLayout in my MainPage was not updated ...</li>
  <li>If I dont call my task method: no rendering problem!</li>
  <li>If I dont touch controls in my task method: no rendering problem !</li>
  <li>If I spam-click &quot;Load control&quot; and &quot;Remove control&quot;, sometimes loaded controls appears...</li>
  </ul>
  <p>Is there a way to tell my StackLayout to update its rendering after adding a control?
  Is there a better way than Task.Factory.StartNew to perform frame animation in a control, so as not to block the rendering?
  (In this example the desired animation has been simplified)</p>
  <h3>Steps to Reproduce</h3>
  <p>My Test solution :
  <a href="https://drive.google.com/file/d/1wkZPgg5MBc5Ij1NuhcQ8i9pVOU7AtM-y/view?usp=sharing" rel="nofollow noreferrer">Test Solution</a></p>
  <p><strong>TestControl</strong></p>
  <pre><code>    public class TestControl : ContentView
      {
          protected Image FaceNormal;
          protected Image FaceLoose;
      
          public TestControl()
          {
              var principalImage = new Image { Source = &quot;fire_principal.png&quot; }; // The body
              FaceNormal = new Image { Source = &quot;fire_facenormal.png&quot; }; // Opened eyes
              FaceLoose = new Image { Source = &quot;fire_faceloose.png&quot; }; // Closed eyes
              Content = new Grid { Children = { principalImage, FaceNormal, FaceLoose } }; // Loaded in the Content
             
             // /!\ Causes rendering errors in the StackLayout
              Task.Factory.StartNew(() =&gt; StartFaceAnimation());
          }
      
          public async Task StartFaceAnimation()
          {
              Dispatcher.Dispatch(() =&gt;
              {
                  FaceNormal.IsVisible = true;
                  FaceLoose.IsVisible = false;
              });
              await Task.Delay(2000);
              Dispatcher.Dispatch(() =&gt;
              {
                  FaceNormal.IsVisible = false;
                  FaceLoose.IsVisible = true;
              });
          }
      }
  </code></pre>
  <p><strong>MainPage</strong></p>
  <pre><code>    public class MainPage : ContentPage
      {
          public MainPage()
          {
              var verticalStackLayout = new VerticalStackLayout();
      
              var loadTestControlButton = new Button { Text = &quot;Load control&quot;, Margin = 2 }; 
              loadTestControlButton.Clicked += (o, e) =&gt; verticalStackLayout.Children.Add(new TestControl()); 
              verticalStackLayout.Children.Add(loadTestControlButton);
              
              var removeTestControlButton = new Button { Text = &quot;Remove control&quot;, Margin = 2 }; 
              removeTestControlButton.Clicked += (o, e) =&gt; verticalStackLayout.Children.Remove(verticalStackLayout.Children.Last()); 
              verticalStackLayout.Children.Add(removeTestControlButton);
      
              Content = verticalStackLayout;
          }
      }
  </code></pre>