WPF Custom Control containing a List of Objects
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?
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.
精彩评论