Setting the Active PivotItem

The SelectedItem or SelectedIndex can be used to shift to a particular PivotItem within the Pivot. If the Pivot is populated using its ItemsSource property, then the SelectedItem retrieves the data object rather than the actual PivotItem control.

Note

Setting a Pivot’s SelectedIndex before it has loaded raises an exception. This can be prevented by suppressing the Exception by wrapping the assignment in a try/catch block, or by performing the assignment in a Loaded event handler.

Get Windows® Phone 8 Unleashed now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.