Avalonia Layout and Virtualization
Start with:
../../references/30-layout-measure-arrange-and-custom-layout-controls.md
../../references/21-custom-layout-authoring.md
../../references/20-itemscontrol-virtualization-and-recycling.md
Load these when scrolling or templates are involved:
../../references/57-scrollviewer-offset-anchoring-and-snap-points.md
../../references/38-data-templates-and-idatatemplate-selector-patterns.md
Workflow
- Define layout contract first: desired size, final arrangement, invalidation rules.
- Use built-in panels and recycling paths before creating a custom panel.
- Verify how virtualization, scrolling, and templates interact on large data sets.
- Measure before and after changes when performance is the reason for the work.
Rules
- Use
InvalidateMeasure and InvalidateArrange deliberately.
- Avoid per-item heavy logic inside measuring and arranging hot paths.
- Keep virtualization-friendly templates light and deterministic.