Reputation: 3718
I have two pivot items on a page , I want to show specific pivot item based on the previous page buttons.I have two buttons named "contact" and "help".I want that when user clicks contact button item 1 shows first, when user clicks help item shows first.How to do that?
Here is my xaml
<Pivot x:Name="MyPivot">
<PivotItem x:Name="contact" >
<PivotItem.Header>
<TextBlock FontFamily="Assets/fonts/KBPlanetEarth.ttf#KBPlanetEarth" Foreground="Purple" Margin="0,20,0,0">Contact</TextBlock>
</PivotItem.Header>
<StackPanel>
<Image VerticalAlignment="Top" Width="250" Height="150" HorizontalAlignment="Left" Source="Assets/icons/logo.png"></Image>
<TextBlock Foreground="Black" FontFamily="Comic Sans MS" TextWrapping="Wrap" FontSize="20">Feel Free to contact for any errors,updates and for don't forget to review.</TextBlock>
<Button Click="Button_Click" Height="80" Width="180" Margin="0,10,0,0" FontFamily="Assets/fonts/Arista2.0.ttf#Arista 2.0" Background="#27aae0" FontSize="25" Content="Email" Foreground="White" HorizontalAlignment="Center" VerticalAlignment="Center" ></Button>
<Button Click="Button_Click_1" Height="80" Width="180" Margin="0,10,0,0" FontFamily="Assets/fonts/Arista2.0.ttf#Arista 2.0" Background="#27aae0" FontSize="25" Content="Facebook" Foreground="White" HorizontalAlignment="Center" VerticalAlignment="Center" ></Button>
<Button Click="Button_Click_2" Height="80" Width="180" Margin="0,10,0,0" FontFamily="Assets/fonts/Arista2.0.ttf#Arista 2.0" Background="#27aae0" FontSize="25" Content="Review" Foreground="White" HorizontalAlignment="Center" VerticalAlignment="Center" ></Button>
</StackPanel>
</PivotItem>
<PivotItem x:Name="helped" >
<PivotItem.Header>
<TextBlock FontFamily="Assets/fonts/KBPlanetEarth.ttf#KBPlanetEarth" Foreground="Purple" Margin="0,20,0,0">Help</TextBlock>
</PivotItem.Header>
<FlipView>
<FlipViewItem>
<Image Source="Assets/7.png"></Image>
</FlipViewItem>
<FlipViewItem>
<Image Source="Assets/15.png"></Image>
</FlipViewItem>
</FlipView>
</PivotItem>
</Pivot>
Upvotes: 1
Views: 1906
Reputation: 3345
You can change what item is shown by changing the value of MyPivot.SelectedIndex
Upvotes: 1