简体   繁体   中英

How save and use navigation context of current part of Panorama Page?

In my panorama Page I can find out what part of panorama is now watching by user:

  void DialogPanorama_SelectionChanged(object sender, SelectionChangedEventArgs e)
            {

                FeedItemViewModel feedItem = null;
                if (e.AddedItems.Count > 0)
                {
                    feedItem = e.AddedItems[0] as FeedItemViewModel;
                    if (feedItem != null) NavigationContext.QueryString["ITEM_ID"] = feedItem.FeedMessage.Guid;
                }

            } 

I have tried to change NavigationContext.QueryString["ITEM_ID"], but then I need to use this Uri in App.xaml.cs, How can I do this?

Why do you need to pass parameters around? You can simple use the Panorama control's SelectedIndex Property to know which panoramaitem is being seen by the user at any given moment :

http://msdn.microsoft.com/en-us/library/microsoft.phone.controls.panorama.selectedindex(v=vs.92).aspx

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.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM