title: Xamarin forms view optimization when IsVisible=false
body: <p>I'm looking for best practice in order to optimize Xamarin Forms app when switching visibility of layouts in order to show them when screen resizing. Xamarin Forms loads any layout either if IsVisible=false. So, what I'm looking  to optimize my app is, load layouts when <code>IsVisible=True</code>, if it turns to <code>False</code>, is there a way to "unload" it so it does not take too much memory of a device? Because there's no problem with UWP, but there are phones with low memory. </p>
  
  <p>Let's suppose I have next code:</p>
  
  <pre><code>    &lt;StackLayout IsVisible="False" Orientation="Vertical"&gt;
          &lt;!-- Make it visible when small screen --&gt;
          &lt;CustomView1&gt;&lt;/CustomView1&gt;
          &lt;CustomView2&gt;&lt;/CustomView2&gt;
      &lt;/StackLayout&gt;
  
      &lt;StackLayout IsVisible="True" Orientation="Horizontal"&gt;
          &lt;!-- Make it NON visible when small screen --&gt;
          &lt;CustomView1&gt;&lt;/CustomView1&gt;
          &lt;CustomView2&gt;&lt;/CustomView2&gt;
      &lt;/StackLayout&gt;
  </code></pre>
  
  <p>Xamarin would load same views 2 times. What I'm looking is like in web, remove it from the DOM (or dont load it in the DOM until it's visible), but for Xamarin Forms. So the app does not load the view when it does not need it, and I'm looking to have it while runtime, on the window app resize.</p>
  
  <p>PS: It could be done by making use of OnIdiom.Phone, OnIdiom.Tablet and OnIdiom.Desktop, but this last, I could not have the view as desired if UWP window app resize.</p>