2011-12-30 57 views

回答

3

樞軸控件有SelectionChanged事件,請使用此在的.xaml文件中添加處理程序。

如..

<controls:Pivot Name= "SamplesPivot" SelectionChanged="SamplesPivot_SelectionChanged"> 
    <controls: PivotItem = "One" > 
     <Grid> 
     </Grid> 
    </controls:PivotItem> 
    <controls: PivotItem = "Two" > 
     <Grid> 
     </Grid> 
    </controls:PivotItem> 
</controls:Pivot> 

在處理函數(在.xaml.cs文件)添加使用PivotControl的selectedIndex指數,並確定選擇的新項目,並做相應的操作。

像..

private void SamplesPivot_SelectionChanged(object sender, SelectionChangedEventArgs e) 
{ 
    if (SamplesPivot.SelectedIndex == 1) 
    { 
     //First item is selected. 
    } 
} 
0

樞軸具有一個SelectionChanged事件處理此

相關問題