views:

24

answers:

1

Hi, I have an object Trip in my object model containing a list of Nodes (e.g. NodeName, StartDate and EndDate) and I am trying to build a Custom control in WPF that draws list of rectangles: one for each Node contained in the Trip object (based on StartDate en EndDate)

Would you have any hint on how the Custom Control should be structured so that I can bind a Trip object to it and draw the rectangles properly, please?

A: 

You don't need to write a Custom Control for this. Ideally you would use the TreeView for this an write a HierachicalDataTemplate for the Trip object. Additionally you might need change the ControlTemplate of the TreeView too. Going this route is IMHO easier and less error prone.

bitbonk
Thank you, I will give it a try :)
Cecile