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