views:

89

answers:

1

Consider the following Parent/Child relationship. What I would like to know is how I would go about creating a GUI for this with the following requirements:

  1. All Parents or children will contain an image a label and a couple of buttons
  2. Parents will be collapse able
  3. New Parents/Children can be added at any time

I was thinking about using an ItemsControl but am unsure how I would get the nesting to work correctly.

Parent 1  
|-Parent 2  
|-Parent 3  
|--P3 Child 1  
|--P3 Child 2  
|--P3 Child 3  
|---P3 C3 Child 1  
|---P3 C3 Child 2  
+6  A: 

A TreeView seems like the most obvious control for this. It allows you to have nested items, and easy parent and child relationships.

Alastair Pitts
Will it allow me to have mutiple controls contained within a treenode i.e. Image Label 2 buttons?Pardon my ignorance I am fairly new to WPF
Burt
Yes, it will, no problem. Check out the ItemTemplate property.
itowlson