Pivot represents a control that provides quick navigation of views within an app.
Step 1: Open a blank app and add a Pivot Control either from the toolbox or by copying the following XAML code into your grid.
- <Pivot x:Name="rootPivot" Title="PIVOT TITLE">
- <PivotItem Header="Pivot Item 1">
- <TextBlock Text="Here you can add any controls" />
- </PivotItem>
- <PivotItem Header="Pivot Item 2">
- <TextBlock Text="Here you can add any controls" />
- </PivotItem>
- <PivotItem Header="Pivot Item 3">
- <TextBlock Text="Here you can add any controls" />
- </PivotItem>
- </Pivot>
Use a Pivot to present groups of content that a user can swipe through. You typically use a Pivot as the top level control on a page. Pivot is an ItemsControl, so it can contain a collection of items of any type. Any item you add to the Pivot that is not explicitly a PivotItem is implicitly wrapped in a PivotItem. Because a Pivot is often used to navigate between pages of content, it's common to populate the Items collection directly with XAML UI elements.
Step 2: Run your application and test yourself.