I am using listview to show contacts number in xamarin forms. On clicking any cell I want to change content of only that particular cell. Following is my code:
lst_view.ItemSelected += async (object sender, SelectedItemChangedEventArgs e) =>
{
var con =(Contact)e.SelectedItem;
int index=contactList.IndexOf(con);
if (con.is_selected)
{
contactList[index].is_selected = false;
contactList[index].img = "";
}
else{
contactList[index].is_selected = true;
contactList[index].img = "selected_checkbox.jpeg";
}
lst_view.ItemTemplate = new DataTemplate(typeof(ContactsItemCell));
};
It is working fine but as end I am giving new datatemplate thats on clicking cell whole listview redraw and which is annoying experience. I just want to update that cell, not whole listview. By the way on clicking I am changing image of that cell through binding with valueconverter.