Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.
In This Chapter |
Chapter 6, “Layout with Panels,” examined the variety of panels included with WPF. If none of the built-in panels do exactly what you want, you have the option of writing your own panel. Of course, with all the flexibility of the built-in panels, the layout properties on child elements (discussed in Chapter 5, “Sizing, Positioning, and Transforming Elements”), plus the ability to embed panels within other panels to create arbitrarily complex layout, it’s unlikely you’re going to need a custom panel. Actually, you never need a custom panel; with enough procedural code, you can achieve any layout with just a Canvas. It’s just a matter of how easy and automatic you want to be able to repetitively apply certain types of layout.