2011-12-30 58 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事件处理此

相关问题