There is no connection between the
Person
and
NodeDetails
classes. To copy a list of
Person
objects into a list of
NodeDetails
objects, you would need to create a new
NodeDetails
instance for each
Person
, and copy the relevant properties.
foreach (Person person in listOfPeople)
{
listOfNodeDetails.Add(new NodeDetails
{
Name = person.Name,
IsChecked = person.IsChecked,
...
});
}
NB: There will not be any connection between the objects in the two lists. Updates to objects in one list will not affect the objects in the other list.