How to signout from windows live using signin button inWindows Phone7?

Go To


Iam new to Window Phone Development. Now Iam sign in into windows live id using sign In button control.

Now my problem is how to sign out from the account by vlicking a button in windows phone.

please send me the sample code .


2012-04-04 05:17
by Raja Ramesh


When I click SignIn button, it changes to SignOut. Just listen for SessionChanged event

<my:SignInButton SessionChanged="OnSessionChanged" 
SignInText="Sign in to skydrive"/>

public void OnSessionChanged(Object sender, LiveConnectSessionChangedEventArgs args)
  if (args != null && args.Session != null && args.Status == LiveConnectSessionStatus.Connected)
  } else {
    SignedOutUser() //any logic you want to implement - hide textbox, change labels, etc.
2012-04-05 09:35
by luccio
i know this. but after logout, again u want to login, it directly taking to previous email id, it is not asking for enter emai id. i need to kill the sessions , but they are readonly. how to getrid of these issue, thanyou for ur reply, plz hel - Raja Ramesh 2012-04-06 03:47
Email is predefined, but in login screen there is a link "Not you" and that allows you fill in email and pwd. I don't know if there is any other option. See link with screenshot:!168&parid=76A1009A04952EBF!119

Or there is one more page - predefined email and only pwd input with link "Sign in using a different account - luccio 2012-04-06 07:42

Hmm, i know luccio. But client asked me to do so. whenever i clicked signout need to clear all about previous email. and when i going to login i should ask email, pwd. NO COMPRAMISE IN THIS ISSUE - Raja Ramesh 2012-04-06 09:45
what about deleting the button and create new one? It might help, but I didn't try i - luccio 2012-04-06 11:57


When you want to do sign out, you could define a WebBrowser signOutBrowser, then set signOutBrowser's source as follows,

string signouturl = " ID&scope=wl.signin%20wl.skydrive%20&redirect_uri=http...";

this.signOutBrowser.Source = new Uri(signouturl, UriKind.Absolute);
2012-11-06 07:58
by dop_nj