Use polymorphism instead of manual RTTI in AppPanel.All components have to inherit the abstract class