I have two similar classes in C#
public class Property
{
public string version;
public string CCodeName { get; set; }
public string CDoc { get; set; }
public string ShortName { get; set; }
}
public class PropertyFieldsInExcel
{
public string ShortNames { get; set; }
public string CNames { get; set; }
public string CDoc { get; set; }
public string Version { get; set; }
}
After this I have created two lists.
static List<PropertyFieldsInExcel> listA = new List<PropertyFieldsInExcel>();
public List<Property> listB = new List<Property>();
Now, I want to have a two-way binding between these two lists. As in, whenever something changes in listA
the corresponding element in listB
must get updated.
Like if, listA[i].ShortName = "abc"
then listB[i].ShortName
also must have the same value.
listA.Add()
should trigger listB.Add()
and vice versa.
Thank you!