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!

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.

What is Windows Azure


Want to know more about Windows Azure and it benefits?
How does Windows Azure work?
How does it let you concentrate more on your code and less on operations, maintenance and scaling?
Let Steve Marx from Microsoft draw you a picture.

Introduction to Gestures in Windows Phone 7


A Windows Phone 7 device touch input in the form of gestures. In Windows Phone OS, a touch gesture involves tapping or swiping one or more fingers on a touch screen.
A Windows Phone 7 Application can use the following gestures:
Single-touch gestures
  • Tap
  • Double Tap
  • Pan
  • Flick
  • Touch and Hold
Multi-touch gestures
  • Pinch and Stretch

Wednesday, August 10, 2011

Theme dependent panorama background

Windows Phone 7 provides various theme based resource which change automatically depending on the currently selected theme i.e. dark or light.

You can use these resources for all controls except the case of a panorama background. In such a case you can use a Brush property in your view model to change the panorama background depending on the currently selected theme.


public ImageBrush PanoramaBackgroundImage
{
  get
  {
    var lightThemeEnabled = (Visibility)Application.Current.Resources
["PhoneLightThemeVisibility"] == Visibility.Visible

    var url = lightThemeEnabled ? "/Images/PanoramaBackground_light.jpg"
                             : "/Images/PanoramaBackground_dark.jpg";

    var brush = new ImageBrush
    {
        ImageSource = new BitmapImage(new Uri(url, UriKind.RelativeOrAbsolute))
    };
    return brush;
  }
}

The only thing left is to bind the background of the panorama to this property. You may also need to add a design time value to this field for design time rendering purposes.

Related Links

Tuesday, August 9, 2011

Page Transitions in Windows Phone 7 – Part 2

Previously, I have published some information about page transitions available in Windows Phone 7. I would recommend to read this post to get a summary of what has already been discussed. As I have mentioned before, there are many transitions available from the Silverlight toolkit:
  • Turnstile Transition
  • Swivel Transition
  • Slide Transition
  • Roll Transition
  • Rotate Transition
Lets take a look at all of these transitions in detail.

Turnstile Transition


This transition is similar to turning a page from one corner. A turnstile transitions is the most common and simplest to use.
It has four modes BackwardIn, ForwardIn, BackwardOut and ForwardOut. Like the name suggests these modes are applicable for while navigating in and navigating out.

    <toolkit:TransitionService.NavigationInTransition>
        <toolkit:NavigationInTransition>
            <toolkit:NavigationInTransition.Backward>
                <toolkit:TurnstileTransition Mode="BackwardIn"/>
            </toolkit:NavigationInTransition.Backward>
            <toolkit:NavigationInTransition.Forward>
                <toolkit:TurnstileTransition Mode="ForwardIn"/>
            </toolkit:NavigationInTransition.Forward>
        </toolkit:NavigationInTransition>
    </toolkit:TransitionService.NavigationInTransition>
    <toolkit:TransitionService.NavigationOutTransition>
        <toolkit:NavigationOutTransition>
            <toolkit:NavigationOutTransition.Backward>
                <toolkit:TurnstileTransition Mode="BackwardOut"/>
            </toolkit:NavigationOutTransition.Backward>
            <toolkit:NavigationOutTransition.Forward>
                <toolkit:TurnstileTransition Mode="ForwardOut"/>
            </toolkit:NavigationOutTransition.Forward>
        </toolkit:NavigationOutTransition>
    </toolkit:TransitionService.NavigationOutTransition>


Swivel Transition

A Swivel Transition is exactly similar to a turnstile transition from a developers point of view. When this transition is applied it appears as if the page comes to the front or from the back vertically.