Tutorial :Using WPF's TreeView to draw trees


I'd like to use a WPF System.Windows.Controls.TreeView to visualize a tree in the style of graph/network layout (e.g. graphviz). The default layout of the TreeView control looks, of course, like Windows Explorer's directory viewer. So I need to change the layout to put the root at the top, its children spaced out beneath it and so on.

Moreover, I'd like to do this programmatically from F#. All of the related samples I have found (e.g. this one) do this using a pile of XAML and I have not been able to translate it into F# code.


This is not exactly what you're asking for, but I share it in case it helps... this blog has an example of WPF-code to draw binary trees (but the layout is simple/dumb).


Oh yeah, you can maybe combine with code here:

Pretty print a tree

which was console pretty-printing with good layout, and maybe together the two pieces lead to something nice (I have not tried).

Note:If u also have question or solution just comment us below or mail us on toontricks1994@gmail.com
Next Post »