I have a Pivot with data binding.

 <Pivot ItemsSource="{Binding MyList}"> <Pivot.ItemTemplate> <DataTemplate> <TextBlock Text="Перелистни меня!"/> </DataTemplate> </Pivot.ItemTemplate> </Pivot> 

In the code-behind, let's say a simple List:

 List<int> MyList = new List() {1,2,3,4,5}; 

For simplicity, the list is just 5 elements, no matter what. Just build 5 pages of Pivot, the content is not important.

How can I assign and track a page turning event between the elements of this Pivot ?

    1 answer 1

    You need a SelectionChanged event.

     private void pivot_SelectionChanged(object sender, SelectionChangedEventArgs e) { System.Diagnostics.Debug.WriteLine(pivot.SelectedIndex); }