O'Reilly logo

XAML Unleashed by Adam Nathan

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

Grid

Grid is the most versatile panel and probably the one you’ll use most often. (Visual Studio projects use Grid by default, even when you create a blank project.) It enables you to arrange its children in a multirow and multicolumn fashion, and it provides a number of features to control the rows and columns in interesting ways. Working with Grid is like working with a table or CSS grid in HTML.

Listing 6.2 uses Grid to build a user interface somewhat like the Windows 8.x Start screen. It defines a 7x8 Grid and arranges children in many of its cells.

LISTING 6.2 First Attempt at a Start Screen Clone Using a Grid

<Grid Background="#1D1D1D">  <!-- Define seven rows: -->   <Grid.RowDefinitions>     <RowDefinition ...

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