Random geekery since 2005.

Husband, father, programmer, speaker, writer, blogger, podcaster, collector, traveler, golfer.

What I Learned In WP7 – Issue 14

Written in

by

I’ve been working on some dynamic Panorama designs, but there were a couple of things I was finding tricky:

1) Loading a Panorama control at a specific position. (also just navigating to a different place in one.)

2) Preventing a Panorama from wrapping around from the last to the first element.

In the first case, I just wasn’t looking in the right place.  To change which panel of a Panorama you are viewing, you can use:

Panorama.DefaultItem = Panorama.Items[index];

For the second case, you might be asking WHY I would want to prevent the Panorama from wrapping around, which is the default behavior.  In my application, when you first come to the Panorama control, you only have ONE PanoramaItem.  So scrolling is more confusing than anything else.  As you continue to enter data into the app, however, the Panorama can grow to as many as 10 Panorama items.

The short story on this, however, is that it’s not really possible.  If you need to change the Panorama’s behavior that drastically, you might want to look at using a different control.

Tags

4 responses to “What I Learned In WP7 – Issue 14”

  1. Jeff Williams Avatar
    Jeff Williams

    I was just curious how you came up with the Panorama being limited to 10 items. The article 'Understanding Windows Phone 7 Panorama Control' states you can add as many items as you want. Now, I understand that too many would simply overload the app, but is 10 a rule of thumb we should be using? I currently have an app that uses 14 which seems to function just fine.

  2. jeffblankenburg Avatar

    Jeff,

    I was actually referring to MY application in that example. There's not a specific limit, though I have heard recommendations to not go over seven. (I built one with the alphabet…that's 26!)

  3. Jeff Williams Avatar
    Jeff Williams

    Good to know. Thank You!

  4. Leon Zandman Avatar
    Leon Zandman

    In my experience setting the DefaultItem totally changes the Panorama layout. It doesn't reposition the Panorama, but it alters it, so that the DefaultItem becomes the first PanoramaItem in the Panorama. And that is often not the thing you want.

Leave a Reply

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

WordPress.com Logo

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

Facebook photo

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

Connecting to %s

Create a website or blog at WordPress.com

%d bloggers like this: