Twitter Feed Popout byInfofru

OverrideThis.com

Adventures in .NET Software Craftsmanship!

WinJS: Do I have internet access?

Odds are the new shiny Windows Store application you are writing will pull some information from the internet for your users to consume.  In fact, the default templates that Microsoft provides already make that assumption. That makes it very likely that you will want to know if the device your application is running on has an active internet connection.  Well Microsoft provides us with a very rich Network API (click here for more info) that you could use to answer such a question. But if want to write less code or want to provide an abstraction layer from WinRTs API, then you could write something similar to this: 

A very basic sample would look like:
 

Or my favorite style: