I can't wrap my head around how to accomplish rendering this
public class Shape{}
public class Circle: Shape{}
public class Square: Shape
{
public List<Circle> CircleList{ get; private set; }
}
I have a List that holds Shape objects, now what I want to accomplish is having each object rendered in a grid.
If the object is a Square there should be a nested grid that holds Circle items from the CircleList property
I've tried with an ItemsControl and a HierarchicalDataTemplate, could not get it working, i've tried nesting an ItemsControl inside an ItemsControl, i'm pretty new to WPF so i'm kinda fumbling around here not knowing what the "proper" solution would be. I did manage to render the above in a TreeView, but what i'm trying to accomplish is a drawingboard that renders shapes.
UPDATE
The "Drawingboard" should contain items, each item should be rendered in a container.
If the object is of Type Square the Square container should have a nested container to hold the Circle objects from the CircleList Property.