08.01.2015 Views

Beginning Web Development, Silverlight, and ASP.NET AJAX

Beginning Web Development, Silverlight, and ASP.NET AJAX

Beginning Web Development, Silverlight, and ASP.NET AJAX

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

192<br />

CHAPTER 8 ■ .<strong>NET</strong> 3.0: WINDOWS PRESENTATION FOUNDATION<br />

<br />

<br />

<br />

<br />

<br />

<br />

As you can see, the buttons aren’t placed on the grid, so WPF draws them in the<br />

default position, which is the top left of their container. Select any button in the Designer<br />

<strong>and</strong> look at its layout properties. You’ll see cells where you can enter a row <strong>and</strong> a column,<br />

<strong>and</strong> these are used to place the button in its containing grid (see Figure 8-15). Grid cells<br />

are zero-based, so setting Row to 1 <strong>and</strong> Column to 1 in a three-by-three grid sets the button<br />

to the center of the grid.<br />

Figure 8-15. Setting where the button resides in the grid<br />

After setting the Row <strong>and</strong> Column properties for a few buttons, your XAML will now<br />

look something like this:<br />

<br />

<br />

<br />

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!