Iam new to Window Phone Development. Now Iam sign in into windows live id using Windows.live.controls.dll 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 .
THANKS IN ADVANCE
When I click SignIn button, it changes to SignOut. Just listen for SessionChanged event
<my:SignInButton SessionChanged="OnSessionChanged"
Content="Button"
BorderThickness="0"
ClientId="YOUR_ID"
Scopes="wl.skydrive_update"
RedirectUri="https://oauth.live.com/desktop"
Branding="Skydrive"
TextType="Custom"
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.
}
}
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
When you want to do sign out, you could define a WebBrowser signOutBrowser, then set signOutBrowser's source as follows,
string signouturl = "https://login.live.com/oauth20_logout.srf?client_id=client ID&scope=wl.signin%20wl.skydrive%20&redirect_uri=http...";
this.signOutBrowser.Source = new Uri(signouturl, UriKind.Absolute);