问题
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.
Loop through
Panorama.Items
and remove every item except for the one you want to focus on. Use afor
loop instead offoreach
to do this since you can't modify the collection while iterating using the latter.Call
Panorama.UpdateLayout
to force the panorama to redraw itself and switch to item you want to display.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