Notifications & Metro Style apps in Windows8 : Local Toast

As explained in the previous post about notifications in Windows8, notifications can be local or from the Cloud ( push ) .

In this post, we will be discussing the local notifications.

Start a new project

       Visual Studio 11 Developer Preview –> New Project –> JavaScript –> Blank Application


Define the notification

      In the ‘js’ folder, let’s add a new item: a javascript file called toast.

js folder

      You should first choose a template for your toast, you can refer to Toast Template Type.

      Back to the toast.js where we will write the following code :

toast code

“This example uses the ToastImageAndText01 template, which consists of a large image with, to its right, a single string wrapped across three lines of text.

To specify the content, we retrieve the collection of text elements then enumerates through that collection, assigning a string to each of those elements . It then retrieves the image element and assigns it an image and alt text.” Windows dev center – Metro Style apps

See the toast in action

    We need to let the application send the toast.

    In the ‘ default.html’ file, add a reference to the toast script :



Voila ! Quick and easy Sourire


About rabeb

Unapologetic Muslim, Tunisian,Arab, African, Woman-In-Tech, Engineer, Developer advocate for Nexmo, Feminist, Traveller, Blogger, Woman. Proud of all of the above.

Posted on December 18, 2011, in Metro Style, Notifications, Windows 8 and tagged , , , . Bookmark the permalink. Leave a comment.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: