WP7 how to store LiveConnectSession during TombStoning?

筅森魡賤 提交于 2019-12-06 06:48:15

问题


I'm using the windows live sign in strategy of the PhotoSkyOnTheGo example provided by MS. So when my app starts, it shows a windows live sign in page.

During app runtime I remember the LiveConnectSession to connect to SkyDrive.

Now when the app tombstones, I need a way to save the LiveConnectSession. IsolatedStorageSettings.ApplicationSettings does not work, probably because the LiveConnectSession is not serializable (it shows some InvalidDataContractException in the debug output).

So how do I store the Session in case the app tombstones? Or is the provided PhotoSkyOnTheGo-example rubbish and I need to be able to reconnect anytime I'm accessing SkyDrive?


回答1:


If your app uses wl.offline_access scope than the live:SignInButton control saves it for you and loads it automatically. Just use the SessionChanged event to capture the session object. This way the user will need to sign in only once.

Scope: http://msdn.microsoft.com/en-us/library/live/hh243646.aspx#wlofflineaccess

Event: http://msdn.microsoft.com/en-us/library/live/microsoft.live.controls.signinbutton.sessionchanged.aspx



来源:https://stackoverflow.com/questions/10946629/wp7-how-to-store-liveconnectsession-during-tombstoning

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!