There are a few posts out there that explain using the Silverlight API to detect networks and connections. Some simple, and some a little more complete.
None of them really suited what I needed, which was a simple class that I could bind a UI element to, that would reflect the internet connectivity.
So I spent a few minutes writing a class of my own, using the knowledge gained from the articles above:
1) Must have a property that fired a property changed event: IsConnectedToInternet
2) This property must be updated on the UI thread, so as not to cause cross thread access error
3) Connection status needed to be polled, in order for property to be updated.
4) Singleton Pattern for ease of use.
Here’s the code if anyone’s interested:
No comments:
Post a Comment