Runtime - Get Unscaled Width of Visual Element

Is there a way to find out the width of a particular visual element that is unscaled value that is not affected by the Panel Scaler?

VisualElement.layout will get you the Rect of the element without scaling. This is only valid after the layout pass so it will contain NaN values before that.

To be notified when the layout has changed, you can register a callback for GeometryChangedEvent:

1 Like