views:

95

answers:

1

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.

+1  A: 

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).

EDIT

Oh yeah, you can maybe combine with code here:

http://stackoverflow.com/questions/1733311/pretty-print-a-tree/1733447#1733447

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

Brian
Why do I get the impression F# makes half of WPF redundant? ;-)
Jon Harrop