Quantcast
Channel: Xamarin.Forms — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 58056

Databinding broken with 1.2

$
0
0

Databinding doesn't work anymore.. the last value in collection is just bound however many times there are items in the collection

XAML:

<?xml version="1.0" encoding="utf-8" ?>
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
                       xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
             xmlns:a="clr-namespace:TestProject;assembly=TestProject"
                       x:Class="TestProject.Main">

    <ListView ItemsSource="{Binding Values}">
      <ListView.ItemTemplate>
        <DataTemplate>
          <ViewCell>
            <ViewCell.View>
              <Label Text="{Binding}"></Label>
            </ViewCell.View>
          </ViewCell>
        </DataTemplate>
      </ListView.ItemTemplate>
    </ListView>
</ContentPage>

CS:

namespace TestProject
{
    using System;
    using System.Collections.Generic;
    using System.Linq;

    using Xamarin.Forms;

    public partial class Main : ContentPage
    {
        public Main()
        {
            this.BindingContext = new
            {
                Values = new[] { "ABC", "DEF", "GHI" }
            };

            InitializeComponent();
        }
    }
}

I've attached the output

Thanks


Viewing all articles
Browse latest Browse all 58056

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>