How to get a random item from the tree given a parent node?
- by Bryan
I have a scenario where I would like to randomize the display of some items. Given a Parent item, how can I randomly select one of its child items?
Of course I could load ALL the children and apply some random index or whatnot... but that would be wildly inefficient.
I'm wondering if this is also inefficient:
Parent.Children[random(Parent.Children.Count)]?
At what point do the items get loaded when you access Parent.Children?