How to generate a forest, supposing I hava some root-nodes?


#1

Hi, how to data-binding or what can I do in the model or Treelayout if I want to generate a forest?
I can get the root nodes and their children of course, just dont know how they can be displayed.
Thank you!


#2

TreeLayout does that automatically. Try it.

You can also set http://www.goxam.com/2.2/helpWPF/webframe.html#Northwoods.GoWPF~Northwoods.GoXam.Layout.TreeArrangement.html to control how the trees are arranged relative to each other.


#3

Thank you, walter.
Here is another question, If I have two trees, the roots have some same children. For example, A and F are roots of two trees. A has 3 children B, C, D. and F has 4 children B, C , E. Can the two trees be displayed normally, since the B,and C has different parents?
I 'd like the forest to be shown like this
%E6%88%AA%E5%9B%BE


#4

You could just implement them as duplicate Nodes. WPF does not allow a Framework element to be in multiple places at the same time.