我目前正在开发一个带有全景页面的Windows Phone 7.5应用程序。 在全景页面上,我正在实施一个appbar来处理应用中的一些内容,例如在Bing地图中显示手机位置,该地图位于其中一个全景页面项目中。
现在,我相信我有两个选择,但我不知道他们将如何工作(如果他们甚至工作......):
仅显示与当前页面/项目相关的appbar图标 如果您不在相应的页面/项目中,请在单击应用栏图标时重定向到页面/项目。这些中的任何一个真的有效吗? 我可以为每个全景项目设置ID,然后使1或2工作吗?
谢谢 :)
I'm currently developing a Windows Phone 7.5 app with a panorama page. At the panorama page, I'm implementing an appbar to deal with several things in the app, such as displaying phone location in a Bing Map which is located in one of the panorama page items.
Now, I believe I have two options, but I don't know how they would work (if they even do work...):
Show only appbar icons relevant to current page/item If you're not at the respective page/item, redirect to the page/item when clicking the appbar icon.Would any of these actually work? Could I set an ID for each of the panorama items, and then make either 1 or 2 to work?
Thanks :)
最满意答案
两者都有可能实现。
要仅显示与页面相关的appbar图标,您可以使用Panorama.SelectionChanged事件:
var currentPanormaItem = ((Panorama)sender).SelectedItem if(currentPanormaItem.Equals(firstPageItem)) { // Set AppBar icons for first page } else if(currentPanormaItem.Equals(secondPageItem)) { // Set AppBar icons for secondpage }如果您知道选择了哪个全景项目,则可以相应地设置appbar图标。
更改 Panorama 的所选项目可以像这样完成:
panoramaControl.DefaultItem = panoramaControl.Items[indexToSet];虽然可以更改Panorama的选定索引,但我建议使用Pivot控件。 使用Pivot控件,可以更轻松地跟踪所选项目,并在编程切换所选页面时获得精彩动画。
Both are possible to accomplish.
For showing only the appbar icons relevent to the page you can use the Panorama.SelectionChanged Event:
var currentPanormaItem = ((Panorama)sender).SelectedItem if(currentPanormaItem.Equals(firstPageItem)) { // Set AppBar icons for first page } else if(currentPanormaItem.Equals(secondPageItem)) { // Set AppBar icons for secondpage }If you know which panorama item is selected you can set the appbar icon accordingly.
Changing the selected item of a Panorama can be accomplished like this:
panoramaControl.DefaultItem = panoramaControl.Items[indexToSet];Though changing the selected index of a Panorama is possible, I would advise using a Pivot control. With a Pivot control it is easier to keep track of the selected item and you get a nice animation when you programatically switch the selected page.
更多推荐
发布评论