Navigate between panorama items wp7

无人久伴 提交于 2019-12-02 05:48:45

问题


I just want to Know, how can I navigate between different panorama items in wp7 through c# code.

Thank you.


回答1:


Try this

Panorama.SetValue(Panorama.SelectedItemProperty, selectedItem);

This might solve the issue.




回答2:


Just set the default item to which item u want to load for the user's view..

panSOS.DefaultItem = panSOS.Items[1];



回答3:


I haven't tried this out, but it should work.

  1. Loop through Panorama.Items and remove every item except for the one you want to focus on. Use a for loop instead of foreach to do this since you can't modify the collection while iterating using the latter.

  2. Call Panorama.UpdateLayout to force the panorama to redraw itself and switch to item you want to display.

  3. Add the items you removed in step 1.




回答4:


If you're panorama control is called PanoramaControl1 then you should be able to use:

PanoramaControl1.SelectedIndex = 0

Where 0 is the first panorama page.



来源:https://stackoverflow.com/questions/10233022/navigate-between-panorama-items-wp7

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!