I have an observable collection in which I want to delete a specific instance element.
eg.
data[1].ChildElements[0].ChildElements[1].ChildElements.RemoveAt(1);
This works fine, however, since it involves deleting children from the tree, I want to dynamically create the above statement, depending on what level the tree clicks. Therefore, I might want:
data[0].ChildElements[1].ChildElements.RemoveAt(0);
or
data[1].ChildElements.RemoveAt(0);
I know the identifier of the parent elements that I saved in the list, for example
0
1
0 or 1,0
My question is, how can I create the above statement when I donβt know exactly how many elements will be in the list collection?
Thank.
source
share