akshaykumar6
akshaykumar6

Reputation: 2257

Controlling pivotItems in pivot in windows phone 7

i want to control that which pivotItem comes at first whenever my app starts? code please

Upvotes: -2

Views: 761

Answers (2)

Santhu
Santhu

Reputation: 1525

OnNavigatedTo of the particular page, in your case default task page,(First page of you application), add the code code to selectItemIndex or SelectedItem.

use the following code , past in Page.xaml.cs

protected override void OnNavigatedTo(System.Windows.Navigation.NavigationEventArgs e)
        {

PivotControl1.SelectedIndex = 5; 

}

It opens the page with the specified pivot item at the first.

Upvotes: 0

Emond
Emond

Reputation: 50702

You can use

myPivotControl.SelectedIndex = 5;

or, if the pivot item has a Name:

myPivotControl.SelectedItem = myPivotItem;

Upvotes: 4

Related Questions