Tools

Namespaces

Variants

Views

Actions

Search

Contents

Please note that as of October 24, 2014, the Nokia Developer Wiki will no longer be accepting user contributions, including new entries, edits and comments, as we begin transitioning to our new home, in the Windows Phone Development Wiki. We plan to move over the majority of the existing entries. Thanks for all your past and future contributions.

Introduction

This code example demonstrates how to add pivot item dynamically. The special thing in this article is that I have added a user control as pivot item. All the event of user control(pivot Item) handled at page level.

Pivot FirstItem

Pivot another item - loaded at runtime

Pivot another item - loaded at runtime

Code Functionality:

The first Pivot item of Pivot is bind to a list collection of user control named (MyPivotItem). Pivotname, PivotValue and PivotType areproperties defined in usercontrol.

}}// Sample code for building a localized ApplicationBar//private void BuildLocalizedApplicationBar()//{// // Set the page's ApplicationBar to a new instance of ApplicationBar.// ApplicationBar = new ApplicationBar();

// // Create a new button and set the text value to the localized string from AppResources.// ApplicationBarIconButton appBarButton = new ApplicationBarIconButton(new Uri("/Assets/AppBar/appbar.add.rest.png", UriKind.Relative));// appBarButton.Text = AppResources.AppBarButtonText;// ApplicationBar.Buttons.Add(appBarButton);

// // Create a new menu item with the localized string from AppResources.// ApplicationBarMenuItem appBarMenuItem = new ApplicationBarMenuItem(AppResources.AppBarMenuItemText);// ApplicationBar.MenuItems.Add(appBarMenuItem);//}}