A way to disable default rendering of VisualElement?

Hello.

I have a custom control that uses generateVisualContent event handler to draw its contents. However, if I set background colour or borders on this control, then I get them rendered as usual.

Is there a way to prevent default rendering from happening? I would love to reuse background colour value as basis for my custom drawing code, for instance, but changing it forces the whole element to be painted.

We don’t have a public feature that allows to disable/replace the default rendering. You would need to use custom VisualElement properties for your custom drawing.