Chapter 5. Layout

This chapter covers

  • The layout system
  • Alignment, margins, and padding
  • Layout rounding
  • Performance considerations

Layout systems across different technologies vary greatly in complexity. Take, for example, the Windows Forms layout system. Fundamentally, that layout system involves absolute X and Y coordinate pairs and an explicit or implicit Z order. Controls can overlap, get clipped (cut off or cropped) on the edge of the window, or even get obscured. The algorithm is pretty simple—sort by Z order (distance from the viewer) and then transfer the pixels to the screen.

For another example, look to HTML and CSS. HTML and CSS support elements that must size to content and page constraints (tables, divs) as well as support ...

Get Windows Store App Development: C# and XAML now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.