Measuring Layout Calls
Introduction
Default Layout Behavior
StackPanel stackPanel = new();
stackPanel.AddToRoot();
stackPanel.Anchor(Anchor.Center);
for(int i = 0; i < 10; i++)
{
float heightBefore = stackPanel.Visual.GetAbsoluteHeight();
Label label = new();
stackPanel.AddChild(label);
float heightAfter = stackPanel.Visual.GetAbsoluteHeight();
label.Text =
$"Label {i + 1} (StackPanel Height: {heightBefore} -> {heightAfter})";
}
Measuring Layouts


Reducing Layout Calls

States and Layout Calls

Last updated
Was this helpful?

