I would like to programmatically navigate to a specific panorama item based upon a click event. I tried doing something like the following
if (Panorama != null && Panorama.SelectedIndex != 3)
{
Panorama.SelectedIndex = 3; //Error, SelectedIndex is read only
}
but the SelectedIndex
property cannot be set. Is there a way to do this in code behind?
Check this out. It's for Windows Phone 7, but I think the same still applies to 8. Maybe you should consider a different navigation model for your app? Or changing the DefaultItem and refreshing the page (I wouldn't recommend this though, it would just look confusing)?
Use this code it would work:
if (Panorama != null && Panorama.SelectedIndex != 3)
{
MyPanorama.DefaultItem = MyPanorama.Items[3];
}
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.