I have two Observable Collections that I need to merge into one collection.
This arises because I have two methods, getTasks(staffID) which returns an ObservableCollection and getTasks(teamID) which selects the staff and pulls back the staff tasks.
For the teams I will have multiple small observableCollections, I just want to merge them.
This is what worked for me:
Concat or Union, but the result is a IEnumerable, so it needs to be converted back into an ObservableCollection:
var result = new ObservableCollection<T>(list1.Concat(list2));
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With