Chapter 4. Working with Layouts
This chapter covers:
- Laying out controls with Panels
- The different layout panels in WPF
- The FlowDocument
- Things named poorly in order to confuse and confound
Starting in the next chapter, we’re going to build a calculator. We know it’s boring and all, but it demonstrates a lot of concepts relative to WPF, and is a simple enough example that the implementation details won’t get too much in the way of what we’re doing. As with any application, one of the key elements is figuring out how to handle the layout of the various controls. Unlike in previous MS frameworks, the idea of layout is a concrete concept in WPF, and there are a number of predefined layouts.
The most powerful layout is the Grid layout, which is big enough to warrant its own chapter (chapter 5). Before we get to that, we’ll explain the idea behind layouts and demonstrate a number of the other built-in WPF layouts. We’ll also talk a bit about some controls and concepts that aren’t technically layouts but have much to do with laying out content.