O'Reilly logo

Illustrated WPF by Daniel Solis

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 5. Layout

Layout in WPF

Before WPF, user interfaces generally consisted of windows with statically placed controls. The programmer set the height and width of a control and placed it at a certain coordinate position on the window or panel, where it stayed. (To be fair, you could also dock controls to edges.)

In WPF, the layout of visual elements is much more dynamic. One of the goals of the WPF layout system is that visual elements should resize and rearrange intelligently when the size of the available window real estate changes. When a window grows or shrinks, the visual elements it contains should automatically change size and position appropriately.

For example, Figure 5-1 shows a window where the buttons in the panel on the left rearrange ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required