SuspensionManager Error when application has more than 1 page in windows 8 XAML/C# app -
i'm writing windows 8 xaml/c# app , have little problem session manager.
within app.xaml.cs onsuspending method looks this:
private async void onsuspending(object sender, suspendingeventargs e) { var deferral = e.suspendingoperation.getdeferral(); //todo: save application state , stop background activity await suspensionmanager.saveasync(); deferral.complete(); }
i have registed rootframe suspensionmanager in onlaunched method in app.xaml.cs:
suspensionmanager.registerframe(rootframe, "appframe");
so, in first page of app have overriden savestate method. looks this:
protected override void savestate(dictionary<string, object> pagestate) { save(true); base.savestate(pagestate); }
when application suspended method called , works fine.
i have 2nd page savestate method same first (so above).
when navigate 2nd page 1st page , suspend application neither of savestate methods called , application crashes following error:
suspensionmanager failed: unspecified error
brilliant!! not information there!!
so, need different suspensionmanager multiple pages?
thanks in advance
suspensionmanager manager works multiple pages - no issues. given little context, suggest following:
- have made changes common files auto-generated when creating vs project using grid app template? if yes - try creating fresh project.
- are passing parameter non-serializable in frame.navigate call? unlikely since in case - can see in output window - winrt information: getnavigationstate doesn't support serialization of parameter type passed frame.navigate.
Comments
Post a Comment