Chapter 5. Controlling Layout with Panels

WHAT'S IN THIS CHAPTER?

  • Measuring and arranging

  • Sizing elements

  • Using and making layout panels

Controlling the layout of an application's user interface (UI) is a problem that has long plagued developers. Over the years, rich-client developers have written thousands of lines of code solely devoted to reposition UI elements in the application as its window size changes. Web developers have long struggled with the multitude of positioning schemes available to them, starting with HTML tables and progressing to CSS layout, and — adding insult to injury — dealing with different browser interpretations of these layout schemes.

Microsoft looked to address many of the basic problems in application user interface layout with Windows Presentation Foundation (WPF) by creating a powerful, flexible, and highly extensible new layout system. Thankfully, they have brought most of those layout concepts into the world of Silverlight. Through the use of layout containers and panels, the Silverlight layout system gives you a level of layout control that was previously difficult, if not impossible, to achieve.

In this chapter, you first learn the basics of the Silverlight layout system and how it works to create flexible application user interfaces, and ways that you can influence how individual UI elements are sized and positioned. Next, you will learn about the different layout panels included in Silverlight that implement these layout concepts. You also learn how ...

Get Professional Silverlight® 4 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.