title: Xamarin ListView (not Forms) binding only appears in one cell
body: <p>I have a ListView implemented in C# in an Android Xamarin page. Each ListView item has labels and bound data. When rendered, the labels show fine in all items, but the bound data only shows in the last item (the others are blank).
  I have verified that the data is in the list being used as the data source.</p>
  
  <p>I have virtually the same page implemented in XAML and it works fine. I don't understand why only one item is being populated in the C# version.</p>
  
  <p>I did notice that I get a number of "requestLayout() improperly called by ..." errors on the C# implementation when running, but have been unable to figure out why this is.</p>
  
  <pre><code>    public EditRoutines()
      {
          Title = "Edit Routines";
  
          Label label0 = new Label { Text = "Count: ", TextColor = Color.Gray, FontAttributes = FontAttributes.None, FontSize = Device.GetNamedSize(NamedSize.Small, typeof(Label)) };
  
          lName = new Label { TextColor = Color.Blue, FontAttributes = FontAttributes.None, FontSize = Device.GetNamedSize(NamedSize.Medium, typeof(Label)) };
          lName.SetBinding(Label.TextProperty, "name");
  
          lCount = new Label {  TextColor = Color.Gray, FontAttributes = FontAttributes.None, FontSize = Device.GetNamedSize(NamedSize.Small, typeof(Label)) };
          lCount.SetBinding(Label.TextProperty, "count");
  
          lDuration = new Label { TextColor = Color.Gray, FontAttributes = FontAttributes.None, FontSize = Device.GetNamedSize(NamedSize.Small, typeof(Label)) };
          lDuration.SetBinding(Label.TextProperty, "duration");
  
          lInterval = new Label { TextColor = Color.Gray, FontAttributes = FontAttributes.None, FontSize = Device.GetNamedSize(NamedSize.Small, typeof(Label)) };
          lInterval.SetBinding(Label.TextProperty, "interval");
  
          DataTemplate dt = new DataTemplate(() =&gt;
          {
              StackLayout sl = new StackLayout
              {
                  HorizontalOptions = LayoutOptions.Fill,
                  Orientation = StackOrientation.Horizontal,
                  Children = {
                      new StackLayout
                      {
                          VerticalOptions = LayoutOptions.StartAndExpand,
                          Orientation = StackOrientation.Vertical,
                          Children = {
                              lName,
                              new StackLayout
                              {
                                  Orientation = StackOrientation.Horizontal,
                                  VerticalOptions = LayoutOptions.StartAndExpand,
                                  Children = {
                                      new Label { Text="Count: ", TextColor=Color.Gray, FontAttributes= FontAttributes.None, FontSize = Device.GetNamedSize(NamedSize.Small, typeof(Label)) },                        
                                      lCount
                                  }
                              },
                              new StackLayout
                              {
                                  Orientation = StackOrientation.Horizontal,
                                  VerticalOptions = LayoutOptions.StartAndExpand,
                                  Children = {
                                      new Label { Text = "Duration: ", TextColor=Color.Gray, FontAttributes= FontAttributes.None, FontSize = Device.GetNamedSize(NamedSize.Small, typeof(Label))},
                                      lDuration
                                  }
                              },
                              new StackLayout
                              {
                                  Orientation = StackOrientation.Horizontal,
                                  VerticalOptions = LayoutOptions.StartAndExpand,
                                  Children = {
                                      new Label { Text = "Interval: ", TextColor=Color.Gray, FontAttributes= FontAttributes.None, FontSize = Device.GetNamedSize(NamedSize.Small, typeof(Label)) },
                                      lInterval
                                  }
                              }
                          }
                      }
                  }
              };
  
  
              return new ViewCell() { View = sl };
          });
  
          Content = new StackLayout
          {
              Margin = new Thickness(20),
              Children = {
              new ListView { ItemsSource = Global.routines.routineList, ItemTemplate = dt, Margin = new Thickness(0, 20, 0, 0), HasUnevenRows = true }
              }
          };
  
      }
  </code></pre>
  
  <p>Here is the XAML that works.</p>
  
  <pre><code>&lt;ListView x:Name="listviewRoutines" HorizontalOptions="FillAndExpand" HasUnevenRows="True" ItemSelected="listviewRoutines_ItemSelected"&gt;
      &lt;ListView.ItemTemplate&gt;
          &lt;DataTemplate&gt;
              &lt;ViewCell&gt;
                  &lt;StackLayout HorizontalOptions="Fill" Orientation="Horizontal"&gt;
                      &lt;StackLayout Padding="5,0,0,0" VerticalOptions="StartAndExpand" Orientation="Vertical" &gt;
                          &lt;Label Text="{Binding name}" HorizontalOptions="StartAndExpand" TextColor="Blue"  FontAttributes="Bold" FontSize="Default"/&gt;
                          &lt;!--
                          &lt;Label Text="{Binding description}" HorizontalOptions="StartAndExpand" TextColor="Gray"  FontAttributes="None" FontSize="Small"/&gt;
                          --&gt;
                          &lt;StackLayout Padding="5,0,0,0" VerticalOptions="StartAndExpand" Orientation="Horizontal"&gt;
                              &lt;Label Text="Count: "  TextColor="Gray"  FontAttributes="None" FontSize="Small"/&gt;
                              &lt;Label Text="{Binding count}" TextColor="Gray"  FontAttributes="None" FontSize="Small"/&gt;
                          &lt;/StackLayout&gt;
                          &lt;StackLayout Padding="5,0,0,0" VerticalOptions="StartAndExpand" Orientation="Horizontal"&gt;
                              &lt;Label Text="Duration: "  TextColor="Gray"  FontAttributes="None" FontSize="Small"/&gt;
                              &lt;Label Text="{Binding duration}" TextColor="Gray"  FontAttributes="None" FontSize="Small"/&gt;
                          &lt;/StackLayout&gt;
                          &lt;StackLayout Padding="5,0,0,0" VerticalOptions="StartAndExpand" Orientation="Horizontal"&gt;
                              &lt;Label Text="Interval: "  TextColor="Gray"  FontAttributes="None" FontSize="Small"/&gt;
                              &lt;Label Text="{Binding interval}" TextColor="Gray"  FontAttributes="None" FontSize="Small"/&gt;
                          &lt;/StackLayout&gt;
                          &lt;StackLayout Padding="5,0,0,0" VerticalOptions="StartAndExpand" Orientation="Horizontal"&gt;
                              &lt;Label Text="When: "  TextColor="Gray"  FontAttributes="None" FontSize="Small"/&gt;
                              &lt;Label Text="{Binding when}" TextColor="Gray"  FontAttributes="None" FontSize="Small"/&gt;
                          &lt;/StackLayout&gt;
                      &lt;/StackLayout&gt;
                  &lt;/StackLayout&gt;
              &lt;/ViewCell&gt;
  
          &lt;/DataTemplate&gt;
      &lt;/ListView.ItemTemplate&gt;
  &lt;/ListView&gt;
  </code></pre>