I have build a WPF application which loads some 3D models. Some of the models have a parent-child relationship, e.g. a tree has some branches and each branch has leaves.
Now I created a class for each type: tree, branch and leave. From within a "branch" object I want to add the leaves with a "AddLeaves()" method. But I don't know what's the best way to access the ViewPort3D object, to which I can add the "leave" objects.
Do I have to implement a "ViewPort3D" member on each class which saves the reference to the viewport? Or is there a easier way to achieve this? Perhaps with DependencyProperies?
How can I access the "children" property of the ViewPort3D object the easiest way?
View Complete Post