Best way to bind node collection to itemscontrol in Silverilght

Posted by mrtrombone on Stack Overflow See other posts from Stack Overflow or by mrtrombone
Published on 2009-03-17T18:09:25Z Indexed on 2010/05/26 6:01 UTC
Read the original article Hit count: 263

Filed under:
|
|

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

© Stack Overflow or respective owner

Related posts about c#

Related posts about Silverlight