In my code I have the two following collections:
private ObservableCollection<Job> listOfJobs1 = new ObservableCollection<Job>();
private ObservableCollection<Job> listOfJobs2 = new ObservableCollection<Job>();
Yesterday I attempted to populate listOfJobs2 with the objects from listOfJobs1, I did it like...
listOfJobs2 = listOfJobs1;
I noticed though that any changes I made to listOfJobs1 were then reflected in listOfJobs2, even in code well down the line.
Is this '=' the equivalent to somehow binding the collections so that they observe each other?
Only reason I ask is because this problem was solved by using a foreach on the listOfJobs1 and programmatically adding to listOfJobs2 using Add(). If I'm right and the two ways of populating a collection are different, can someone point me in the right direction to an article explaining the way this works because I'm about to write a method now that'll hugely depend on whether this is the case. Also, would this be the case if I were to use List<>?