Reputation: 2753
Right now i am trying to navigate between two of the item in a pivot page. may i know if a event handler for this exits?
Upvotes: 0
Views: 780
Reputation: 1525
Pivot Control has the SelectionChanged event, please use this and add the Handler in .xaml file.
like..
<controls:Pivot Name= "SamplesPivot" SelectionChanged="SamplesPivot_SelectionChanged">
<controls: PivotItem = "One" >
<Grid>
</Grid>
</controls:PivotItem>
<controls: PivotItem = "Two" >
<Grid>
</Grid>
</controls:PivotItem>
</controls:Pivot>
In Handler function (in .xaml.cs file) add use the PivotControl's SelectedIndex index and determine the new Item selected, and do the operation accordingly.
as like..
private void SamplesPivot_SelectionChanged(object sender, SelectionChangedEventArgs e)
{
if (SamplesPivot.SelectedIndex == 1)
{
//First item is selected.
}
}
Upvotes: 3