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.

198<br />

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

2. Open the App.xaml file in XAML view <strong>and</strong> change the StartupURI attribute to the<br />

name of the window that you just created (i.e., GetAddresses.xaml). This instructs<br />

the application to load that window at startup.<br />

3. The window will have a grid on it called LayoutRoot. Select this <strong>and</strong> find the<br />

property called DataContext. Click the small square to the right of the New button<br />

in the DataContext editor to open the advanced properties drop-down (see<br />

Figure 8-19).<br />

Figure 8-19. Setting the advanced properties for the Grid’s DataContext<br />

4. On this list, select Data Binding.<br />

5. In the dialog that pops up, select + XML Data to add an XML data source.<br />

6. This gives another dialog (Figure 8-20 shows both dialogs), where you can name<br />

the XML data <strong>and</strong> point it to the XML file that you created earlier.<br />

7. When you click OK, the data source will be created <strong>and</strong> added to the “Data sources”<br />

list on the Create Data Binding dialog. Its fields will be listed on the right. As the<br />

data source has a collection of Address nodes, these will be indicated as an array<br />

in the Fields list (see Figure 8-21).

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

Saved successfully!

Ooh no, something went wrong!