在第一次成功登录&注销窗口实时登录按钮不工作在Windows手机上 [英] After first scuccessful login & logout windows live sign in button is not working on windows phone
问题描述
在创建使用Windows Phone Live帐户&我参考了 Windows Live Sdk示例代码。
Am creating an application which used Windows Phone Live Account & I referred Windows Live Sdk sample code for doing that.
xaml
<Grid x:Name="LayoutRoot" Background="Transparent">
<my:SignInButton Name="btnSignin" ClientId="CLIENT_ID" Scopes="wl.signin wl.basic" Branding="Windows" TextType="SignIn" SessionChanged="btnSignin_SessionChanged" HorizontalAlignment="Left" VerticalAlignment="Top" />
</Grid>
以下是注销代码
public void LogOut()
{
var authClient = new LiveAuthClient(ClientId);
authClient.Logout();
}
但是在我第一次成功登录&注销,我无法登录到真实帐户意味着登录
按钮不工作,即使它没有被禁用。
每次获得一个 LiveConnectSessionStatus.Unknown 状态在
SessionChanged
事件,当我导航到登录页面。这是什么原因?我需要在注销操作中做更多的事吗?请确认。
But after my first successful login & logout, i could not login to the live account means Sign In
button is not working even it is not disabled at all.
And Every time am getting a LiveConnectSessionStatus.Unknown
state on SessionChanged
event when i navigated to the login page. What will be the reason for this? Do i need to do anything more in the logout operation? Please confirm.
感谢
推荐答案
是:
private LiveConnectClient client;
private async void btnSignin_SessionChanged(object sender, LiveConnectSessionChangedEventArgs e)
{
if (e.Status == LiveConnectSessionStatus.Connected)
{
client = new LiveConnectClient(e.Session);
}
else
{
infoTextBlock.Text = "Not signed in.";
}
}
您不必编写自己的Logout - 在您登录后,buton将自己更改为注销。在SignIn和会话更改后,你有客户端 - 你可以做什么你需要的。
You don't have to program your own Logout - after you signin, the buton changes itself to logout. After SignIn and session changed you have Client - with what you can do what you need.
这篇关于在第一次成功登录&注销窗口实时登录按钮不工作在Windows手机上的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!