Question

Is there any reliable and free WPF library to create simple tree diagrams dynamically? I mean, all I want is something that would allow me to do that kind of pseudo-code:

Item item1 = new Item("Level 1");
Item item11 = new Item("Level 1.1");
Item item12 = new Item("Level 1.2");
Item item111 = new Item("Level 1.1.1");

item11.AddChild(item111);
item1.AddChild(item11);
item1.AddChild(item12);

And then to generate automatically the correspoding diagram: My tree diagram

Thank you.

Was it helpful?

Solution

I found this diagram solution and tinkered a bit in order to adapt it to my needs.

I'm kinda surprised there's no library to do so. Still looking for it :)

OTHER TIPS

I've found this one pretty easy to use:
https://www.codeproject.com/Articles/29518/A-Graph-Tree-Drawing-Control-for-WPF

You can find an example how to use it in the downloaded zip file here:
SilverTreeContainer.zip\TreeContainer\TreeContainerTest\winTreeContainerTest.xaml

Later, I also found this article interesting:
How to easily draw graphs in WPF?
This is for Graph drawing in general, not specialized for Trees; but I've found the above link here as well (top rated answer, option 6)

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top