A new home

I’ve made the move to WordPress!

You should be automatically redirected in 5 seconds. Please visit World Wide Code on Wordpress

Hope to see you there!

Saturday, October 8, 2011

How to: Use a Background Worker


In Silverlight, there is a BackgroundWorker class that provides a mechanism to perform time consuming tasks on a background thread.
The BackgroundWorker also allows you to report progress back to the UI thread and also cancel the on going operation.
Here are some steps about how to use the background worker.

Azure Storage Explorer

Windows Azure gives you four core storage services that are secure, scalable and easy to access that remain persistent and durable storage in the cloud.

Azure Storage Explorer


Azure Storage Explorer is a useful GUI tool for inspecting and altering the data in your Windows Azure Storage storage projects including the logs of your cloud-hosted applications.
All 3 types of cloud storage can be viewed and edited: blobs, queues, and tables.

Web Aunthentication Error in Metro Apps


Metro apps in Windows 8 can make use of Web Authentication using the WinRT API.
You may encounter errors while using the AuthenticateAsync method from the WebAuthenticationBroker inside your Metro App.
The Error returned is usually similar, for example
Error returned by WebAuth broker. Error Number: – 2146697211 Error Message: Unknown runtime error.
You must be connected to the internet.

Windows 8: Web Authentication in Metro Apps


You may have used  OAuth 2.0 protocol for authentication and authorization in your Desktop or web based apps. Now, you would like to build a Metro app for Windows 8 which requires web authentication.
For this purpose, there exists a Web Authentication WinRT API do perform the required task.
The web authentication can be performed using C# as well as JavaScript. 

The Past, Present and Future of Parallelizing .NET Applications


In the MSDN magazine article, Stephen Toub explains the use of parallel tasks like PLINQ in .Net 4.0. I recommend reading this article to get some insights on parallel operations whether you use them or not in your applications.
With the Parallel class, you can parallelize it simply as follows:
  1. Parallel.For(0, N, i => {
  2.   … // Process i here
  3. });
Here, the developer is still responsible for ensuring each iteration of the loop is in fact independent, but beyond that, the Parallel.For construct handles all aspects of this loop’s parallelization.

Stephen Toub is a principal architect on the Parallel Computing Platform team at Microsoft.

Tuesday, August 30, 2011

SketchFlow for Windows Phone 7


Many of you might have used SketchFlow for your various applications.
Now that there’s a Sketchflow template for Windows Phone applications, you can (and should) prototype any projects. The time you spend prototyping and working out any issues and finding ambiguities in requirements will be well worth it.


Read more of this post

Isolated Storage in Silverlight


Storing data in the Isolated storage can be useful, however you need to take appropriate precautions.
  • Wrap all calls to isolated storage within try/catch blocks to be resilient to potential IsolatedStorageExceptions, which can be thrown if isolated storage is disabled or if the store has been deleted.
  • If your Silverlight application needs to store a lot of data in isolated storage, consider hosting it on its own site so that it won’t affect other applications on the site and other applications won’t affect it.
  • If you have a group of Silverlight applications that need to share data on the client, host them on the same site.
  • Keep isolated storage paths as small as possible to prevent the internal full path from reaching the 260-character limit.
  • Encrypt sensitive data stored in isolated storage.
  • Use IsolatedStorageSettings to store objects and simple settings in isolated storage.
  • Use IsolatedStorageFile if you want to use file and stream-based APIs, are storing large amounts of data, or need fine-grained control over the contents of isolated storage.