23.01.2018 Views

MICROSOFT_PRESS_EBOOK_PROGRAMMING_WINDOWS_8_APPS_WITH_HTML_CSS_AND_JAVASCRIPT_PDF

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

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

Giddy on the day he learned to sit up!<br />

<br />

<br />

<br />

This is Liam<br />

Exploring the great outdoors!<br />

<br />

<br />

<br />

• Run the website in Internet Explorer using the Debug > Start Debugging command or the<br />

Internet Explorer toolbar button (where you’d find the Local Machine or Simulator options in<br />

Visual Studio Express 2012 for Windows 8). This will launch Internet Explorer with a URI like<br />

http://localhost:52568/HelloTiles/Default.cshtml where the port number is what routes the URI to<br />

the site running in the debugger. If you need to set up your localhost server, see the next<br />

section, “Using the Localhost.”<br />

• Run the Push notifications app sample, switch to Scenario 4, paste the URI into the URI1 field,<br />

and press the Start periodic updates.<br />

• If all is well, you should see the wide tile update as follows. (OK, so it’s another shameless picture<br />

of my kid…what can I say? You have to give us fathers a break!)<br />

• If you use the Start screen’s app bar command to make the tile smaller, thereby using the square<br />

tile payload in the XML, you should see it switch between to another gratuitous picture of my kid<br />

and peek text:<br />

The complete website code for all this can be found in the HelloTiles example in this chapter’s<br />

companion content. As simple as it is, it provides the basic framework in which you can add code to<br />

generate more dynamic results. In the top part of the file, within the @{ }, you can write whatever code<br />

you need by using C#.<br />

Generally speaking, a real service that provides tile and badge updates would probably be connected<br />

on the server side to some other useful source of information, perhaps to an always-running process<br />

that can monitor other sites, extract the desired data, and generate updates. Those updates can be<br />

594

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

Saved successfully!

Ooh no, something went wrong!