Xamarin Forms: StackLayouts, ListViews, and Grids Oh My
<p>I'm struggling with getting my layout to behave.  I'm trying to create a page that shows a person along with a list of their children that lets them update how many children they have.</p>

<p>Here's what I have currently:</p>

<pre><code>&lt;StackLayout Orientation="Vertical" HorizontalOptions="Center"&gt;
  &lt;controls:BindablePicker x:Name="pkrChildren" ItemsSource="{Binding ChildrenItems}" Title="Num. Children" SelectedItem="{Binding Path=CurrentPerson.NumChildren, Mode=TwoWay}" HorizontalOptions="Center" /&gt;
  &lt;ListView x:Name="lvChildren" ItemsSource="{Binding Path=CurrentPerson.Children}" HorizontalOptions="Center" SeparatorVisibility="None"&gt;
    &lt;ListView.ItemTemplate&gt;
      &lt;DataTemplate&gt;
        &lt;ViewCell&gt;
          &lt;ViewCell.View&gt;
            &lt;Grid&gt;
              &lt;Grid.ColumnDefinitions&gt;
                &lt;ColumnDefinition /&gt;
                &lt;ColumnDefinition /&gt;
              &lt;/Grid.ColumnDefinitions&gt;
              &lt;controls:BindablePicker Title="Age" Grid.Row="0" Grid.Column="0" ItemsSource="{Binding Ages}"  SelectedItem="{Binding Path=ChildModel.Age, Mode=TwoWay}" HorizontalOptions="End" /&gt;
              &lt;controls:BindablePicker Title="Units" Grid.Row="0" Grid.Column="1" ItemsSource="{Binding AgeUnits}" SelectedItem="{Binding Path=ChildModel.Unit, Mode=TwoWay}" HorizontalOptions="Start" /&gt;
            &lt;/Grid&gt;
          &lt;/ViewCell.View&gt;
        &lt;/ViewCell&gt;
      &lt;/DataTemplate&gt;
    &lt;/ListView.ItemTemplate&gt;
  &lt;/ListView&gt;
  &lt;Label Text="More Details Below" FontAttributes="Bold" HorizontalTextAlignment="Center" /&gt;
  &lt;ListView VerticalOptions="EndAndExpand" /&gt;
&lt;/StackLayout&gt;
</code></pre>

<p>which looks like this:</p>

<p><a href="https://i.stack.imgur.com/ZFJOF.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/ZFJOF.png" alt="Try 1"></a></p>

<p>What I want is the "More Details Below" label (and subsequent controls) to move up to right beneath the ListView.  Then, if the user changes the number at the top, the ListView should expand or contract (e.g., if they select "5", three new blank rows will appear and everything should shift down).</p>

<p>I hope this is clear.  I'm using MVVM and when I update my list of children, the ListView does add and remove rows, but the controls beneath it don't move; it's almost like the page itself needs to be re-rendered.</p>

<p>I tried adding the ListView at the end with expand to try to push everything up, but that didn't seem to help.</p>

<p>I can probably encase lvChildren in a Grid, but then I need a way for the Grid to shrink and expand when I add or remove children from the list.</p>

<p>Any guidance would be greatly appreciated.  Thank you for your time.</p>

<p>Ed.</p>

<p>UPDATE:  Here are my ViewModels</p>

<pre><code>namespace ShortGameTracker.ViewModels
{
    [ImplementPropertyChanged]
    public class PeopleEntryViewModel
    {
        public IList&lt;string&gt; ChildrenItems { get; private set; }
        public CompanyModel CompanyModel { get; set; }
        public ChildEntryViewModel CurrentPerson { get; set; }

        public PeopleEntryViewModel()
        {
            Initialize();
        }

        public PeopleEntryViewModel(object param)
        {
            Initialize();

            var company = param as CompanyModel;
            CompanyModel = company;

            // We need at least one hole to load the view.
            if (CompanyModel.Employees.Count == 0)
            {
                CompanyModel.Employees.Add(new PersonModel());
            }
            CurrentPerson = new ChildEntryViewModel(CompanyModel.Employees[0]);
        }

        private void Initialize()
        {
            ChildrenItems = new List&lt;string&gt; { "0", "1", "2", "3", "4", "5", "6", "7", "8", "9" };
        }
    }
}

namespace ShortGameTracker.ViewModels
{
    [ImplementPropertyChanged]
    public class ChildEntryViewModel
    {
        private string _NumChildren;
        public string NumChildren
        {
            get
            {
                if (Children == null)
                {
                    return null;
                }
                return Children.Count.ToString();
            }
            set
            {
                if (NumChildren != value)
                {
                    _NumChildren = value;
                    AdjustChildren(Convert.ToInt32(_NumChildren));
                }
            }
        }
        public string ChildNum { get; set; }
        public ObservableCollection&lt;ChildViewModel&gt; Children { get; set; }

        public ChildEntryViewModel()
        {
            Initialize();
        }

        public ChildEntryViewModel(object param)
        {
            var person = param as PersonModel;
            List&lt;ChildViewModel&gt; pvms = new List&lt;ChildViewModel&gt;();
            foreach (ChildModel childModel in person.Children)
            {
                pvms.Add(new ChildViewModel(childModel));
            }
            Children = new ObservableCollection&lt;ChildViewModel&gt;(pvms);
        }

        private void Initialize()
        {
        }

        private void AdjustChildren(int newNumChildren)
        {
            int numToCreate = newNumChildren - Children.Count;
            for (int i = 0; i &lt; numToCreate; i++)
            {
                Children.Add(new ChildViewModel());
            }

            int numToRemove = Children.Count - newNumChildren;
            int idxToRemove = Children.Count - 1;
            for (int i = 0; i &lt; numToRemove; i++)
            {
                Children.RemoveAt(idxToRemove--);
            }
        }
    }
}

namespace ShortGameTracker.ViewModels
{
    [ImplementPropertyChanged]
    public class ChildViewModel
    {
        public IList&lt;string&gt; Ages { get; private set; }
        public ObservableCollection&lt;string&gt; AgeUnits { get; private set; }
        public ChildModel ChildModel { get; set; }

        public ChildViewModel()
        {
            Initialize();
        }
        public ChildViewModel(object param)
        {
            Initialize();

            var childModel = param as ChildModel;
            ChildModel = childModel;
        }
        private void Initialize()
        {
            Ages = new List&lt;string&gt;();
            for (int i = 1; i &lt; 125; i++)
            {
                Ages.Add(i.ToString());
            }
            AgeUnits = new ObservableCollection&lt;string&gt;(new List&lt;string&gt; { "Years", "Months", "Days" });
        }
    }
}
</code></pre>