views:

121

answers:

1

I have a Silverlight project where the main objects are just a bunch of nodes that are joined to each other. A parent node can have many children.

I want to be able to bind the nodes to an itemscontrol or similar and so was wondering how to best structure the parent child relationship.

Is it OK to create a flat top level list of all nodes (List allNodes) and add each node to that, binding the list to the itemscontrol, then on top of that add each node to it's parent's 'childnodes' list to establish the structure - or am I doing some kind of ugly doubling up?

Just hoping there is some kind of best practice or pattern I can latch on to

Thanks

A: 

You should use the treeview found in the official silverlight toolkit. Here is an online demo.

BC
Perhaps I could look at it to implement my controls in the same way. I am not wanting anything that looks remotely like the treeview so I'm not sure how useful it would be.
Mark
I also want to allow for the possibility of a child having multiple parents so it would be inflexible there
Mark