本文介绍了是否有可能通过导航按钮点击事件转动控制页面的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图创建一个WP7支点控制应用。在第一页点击一个按钮,我想转到另一个页面它已经是一个支点页面。 ?是否有可能

I'm trying to create a wp7 pivot control application. On click of a button in the first page, I would like to navigate to another page which is already a pivot page. Is it possible ?

推荐答案

如果您有例如以下的定义为枢轴控件:

If you have for example following definition for the Pivot control:

 <controls:Pivot x:Name="SettingsPivot" Title="settings">
   <controls:PivotItem x:Name="GeneralSettings" Header="general settings">
     <!-- Pivot Item content -->
   </controls:PivotItem>
   <controls:PivotItem x:Name="ConnectivitySettings" Header="connectivity settings">
     <!-- Pivot Item content -->
   </controls:PivotItem>
   <controls:PivotItem x:Name="OtherSettings" Header="other settings">
     <!-- Pivot Item content -->
   </controls:PivotItem>
 </controls:Pivot>



然后就可以在按钮单击事件处理程序使用此代码去为例OtherSettings:

Then you can go to for example OtherSettings using this code in the button click event handler:

SettingsPivot.SelectedItem = OtherSettings;

这篇关于是否有可能通过导航按钮点击事件转动控制页面的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-01 07:45