Hope this helps Here's a functional way you can do it using recursion. The numbered bullet points match the numbered comments in the code below. (base) There is no node so there is nothing left to process; return the result r (induction) There is at least one node. If the node's id or parentid is in the set s, a matching node has been found. Add the node's id to the set and start the search over with the partial result r and the remaining nodes, more. (induction) There is at least one node and it does not match the ids we are searching for. Append the node to the result and continue searching more nodes.
In WPF: Children.Remove or Children.Clear doesn't free objects
By : Victor Stoe
Date : March 29 2020, 07:55 AM
With these it helps Update: I tried this on another, more cleanly installed, machine. I could not reproduce this on that machine. If I find out what offending (VSStudio) component causes this, I will let you know. , Change public class MyControl : UserControl