Understanding Layout in WPF

The WPF layout model represents a dramatic shift in the way Windows developers approach user interfaces. In order to understand the new WPF layout model, it helps to take a look at what's come before.

In .NET 1.x, Windows Forms provided a fairly primitive layout system. Controls were fixed in place using hard-coded coordinates. The only saving grace was anchoring and docking—two features that allowed controls to move or resize themselves along with their container. Anchoring and docking were great for creating simple resizable windows—for example, keeping OK and Cancel buttons stuck to the bottom-right corner of a window, or allowing a TreeView to expand to fill an entire form—but they couldn't handle serious layout ...

Get Pro WPF in C# 2008: Windows Presentation Foundation with .NET 3.5, Second Edition 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.