Query inside VisualElement constructor?

Hello,

I’m trying to make a reusable custom control.

TabPanel is just a C# class derived from VisualElement. It doesn’t have a UXML template. This way I can add new tabs both in UXML and C#.

Problem: when the constructor gets called, neither parent nor children are known. Is there another way to access/query the visual tree of my TabPanel instance?

6133283--668816--devenv_3d9QWIVET8.png

I believe you are suppose to do this stuff when the AttachToPanel change event is fired

1 Like

Thanks, that did the trick!