I’ve got a flat list of items in a ObservableCollection. These items have the properties item.Id and item.Parent.Id.
I’ve been given the id of the parent (top level), now with this id I need to iterate through the list and find the children of this parent. Each child can only have one parent, a parent can have multiple childs.
How can I do this effectively?
You can use:
Edit in response to comments:
Given that you have a hierarchical dataset, I would personally make a routine that checks to see if a given item has a specific item as a parent recursively, like so:
Given this, you could use: