Navigate to selected Pivot Item #wpdev #wp7dev

I have come across a few instances where its desireable to navigate to a certain pivot item rather than landing on default and then finding your way around.

This is very easy. I tend to define some mechanism e.g. an enum for each pivot item. I create a static property (or you can choose whatever data passing mechanism you prefer). I set the property and navigate to pivot page and navigate to correct item.

Here’s how i do it. Itercept the OnNavigatedTo of the Pivot page and set the correct item as selected.

public enum PivotDef

public static PivotDef SelectedPivot;

protected override void OnNavigatedTo(System.Windows.Navigation.NavigationEventArgs e)
   switch (SelectedPivot)
      case PivotDef.One:
         this.pvtControl.SelectedItem = this.pvt1;

      case PivotDef.Two:
         this.pvtControl.SelectedItem = this.pvt2;

      case PivotDef.Three:
         this.pvtControl.SelectedItem = this.pvt3;

      case PivotDef.Four:
         this.pvtControl.SelectedItem = this.pvt4;


sample project is available from

One thought on “Navigate to selected Pivot Item #wpdev #wp7dev

  1. Pingback: Can in I navigate to pivot item from another xaml page in windows phone 7? - Popular Windows Phone Questions

Leave a Reply

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

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

Twitter picture

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

Facebook photo

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

Google+ photo

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

Connecting to %s