views:

375

answers:

1

I'm working on a project where I have some hierarchical data that I want to be able edit through a fancy WPF control.

The data structure is essentially an expression tree. Each node can be a different Expression type but inheriting from the same base class. These different types need to have their own way of editing them.

My thoughts are that I would use the WPF TreeView control and then dynamically add editor controls for each type of Expression. I have only a basic understanding of WPF's data binding and the MVVM pattern so I'm not sure if this is possible to do or even where to begin. Any pointers or guidance would be greatly appreciated.

+2  A: 

It sounds like what you're looking for is the HierarchicalDataTemplate class.

Richard C. McGuire