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

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

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

Figure 8-14. A three-by-three grid layout<br />

Now you can add <strong>and</strong> lay controls out on your window. Note that the window itself<br />

can only contain one child control, <strong>and</strong> in this case that is the Grid. If you want more than<br />

one control within the window, you can use a container <strong>and</strong> place the controls within it.<br />

So, if you had selected the window in Objects <strong>and</strong> Timeline view (see Figure 8-12) <strong>and</strong><br />

double-clicked the Button tool, then the grid would be replaced by a new button. So, be<br />

sure to select the grid in the Objects <strong>and</strong> Timeline selector <strong>and</strong> double-click the Button<br />

tool to add a button to the grid. Repeat this several times to add a few buttons. You’ll<br />

notice that all the buttons are added to the top-left-h<strong>and</strong> corner of the grid. To see why<br />

this is the case, check out the XAML again. It looks like this:<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

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

Saved successfully!

Ooh no, something went wrong!