Answered by:
Navigate a frame to different backstack history

Question
-
I have an app in which I have created two frames and one is visible at a time. Now when then second one becomes visible I want it to navigate to backstack from first frame. I have been able to get the backstack list from first frame but can't get a way to navigate the second frame to history of first frame. Can anybody help?Thursday, April 9, 2015 12:32 PM
Answers
-
If you want to copy the state from one to the other you can do the same thing you do when saving and restoring the Frame's state for suspend and resume: get the state from the one Frame with the GetNavigationState method and set it on the other with the SetNavigationState method
- Marked as answer by RohitrkKUmar Monday, April 27, 2015 5:26 AM
Thursday, April 23, 2015 5:31 AMModerator
All replies
-
It doesn't work that way. Frames hold their own navigation stack. If you need to move to a particular page with particular data, use Frame.Navigate and pass parameters. Why do you want to do this anyway?
Matt Small - Microsoft Escalation Engineer - Forum Moderator
If my reply answers your question, please mark this post as answered.
NOTE: If I ask for code, please provide something that I can drop directly into a project and run (including XAML), or an actual application project. I'm trying to help a lot of people, so I don't have time to figure out weird snippets with undefined objects and unknown namespaces.Thursday, April 9, 2015 7:11 PMModerator -
Apologies for replying late.
I have two frames in which one is visible at one time and on tap of button this hides and second one shows but If some changes are made in first frame then second needs to refresh itself with same navigation history. I'm unable to get it working
Wednesday, April 22, 2015 5:17 AM -
I can't find the reference for this at the moment, but only one frame is allowed in a Windows Phone project, the frame which is created in the App.xaml.cs page. I tried this same kind of thing a while back and was unsuccessful.
Matt Small - Microsoft Escalation Engineer - Forum Moderator
If my reply answers your question, please mark this post as answered.
NOTE: If I ask for code, please provide something that I can drop directly into a project and run (including XAML), or an actual application project. I'm trying to help a lot of people, so I don't have time to figure out weird snippets with undefined objects and unknown namespaces.Wednesday, April 22, 2015 4:12 PMModerator -
yes but we can can create two frames as child of main frame and use these as per requirement. This is what I'm doing and these two child frames are inside same app and just visible and collapsed as per requirement and then on basis of press of buttons I need other one to refresh itself with it's own navigation history.Thursday, April 23, 2015 5:24 AM
-
If you want to copy the state from one to the other you can do the same thing you do when saving and restoring the Frame's state for suspend and resume: get the state from the one Frame with the GetNavigationState method and set it on the other with the SetNavigationState method
- Marked as answer by RohitrkKUmar Monday, April 27, 2015 5:26 AM
Thursday, April 23, 2015 5:31 AMModerator