- we also need to check for base classes (otherwise concrete elements like the layout graphicalobject would not be downcasted into individual types)