Answered by:
FrameSessionStateKeyProperty

Question
-
Hello everyone!
I am trying to register the root Frame in App.xaml.cs file like this :
HelloWorld.Common.SuspensionManager.RegisterFrame(rootFrame, "appFrame");
if (rootFrame == null) { // Create a Frame to act as the navigation context and navigate to the first page rootFrame = new Frame(); HelloWorld.Common.SuspensionManager.RegisterFrame(rootFrame, "appFrame"); ...
but when i debug the SuapensioManager.cs file throw an exception in this line of code :
public static void RegisterFrame(Frame frame, String sessionStateKey)
{
if (frame.GetValue(FrameSessionStateKeyProperty) != null)
{
throw new InvalidOperationException("Frames can only be registered to one session state key");
}What i am doing wrong here ?
Thanks in advance!
- Moved by Rob Caplan [MSFT]Microsoft employee, Moderator Monday, April 28, 2014 1:16 PM
Monday, April 28, 2014 11:23 AM
Answers
-
what exception you get? this one? "Frames can only be registered to one session "
then you are registering the frame multiple times
Microsoft Certified Solutions Developer - Windows Store Apps Using C#
- Marked as answer by Jamles HezModerator Tuesday, May 6, 2014 10:57 AM
Monday, April 28, 2014 12:22 PM -
From the error you report it must be registered twice. Put a break point on RegisterFrame and you should be able to see where the unexpected registration comes from in the debugger
- Marked as answer by Jamles HezModerator Tuesday, May 6, 2014 10:56 AM
Monday, April 28, 2014 1:54 PMModerator
All replies
-
what exception you get? this one? "Frames can only be registered to one session "
then you are registering the frame multiple times
Microsoft Certified Solutions Developer - Windows Store Apps Using C#
- Marked as answer by Jamles HezModerator Tuesday, May 6, 2014 10:57 AM
Monday, April 28, 2014 12:22 PM -
Yes, this one , but i register it only once just like the code aboveMonday, April 28, 2014 1:49 PM
-
From the error you report it must be registered twice. Put a break point on RegisterFrame and you should be able to see where the unexpected registration comes from in the debugger
- Marked as answer by Jamles HezModerator Tuesday, May 6, 2014 10:56 AM
Monday, April 28, 2014 1:54 PMModerator -
I found the error finally! It was registered twice as you said... Thank you for your help!!Monday, April 28, 2014 7:58 PM