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

问题描述

我正在尝试创建一个 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 ?

推荐答案

例如,如果您对 Pivot 控件有以下定义:

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