有没有其他人有Windows Phone 8的SkyDrive API的问题?我升级我的Windows Phone 7的代码到Windows Phone 8。当我点击登录按钮(网盘),我得到了以下画面:skydrive api windows phone 8
此代码(从WP7不变)用于VS2010工作。 其他人有这个问题吗?是否有我应该使用的更新版本(当前版本v2.0.50727)?
当前XAML:
HorizontalAlignment="Left" Margin="308,71,0,0"
Name="signInButton1" VerticalAlignment="Top" Width="160"
ClientId="[myID]" Scopes="wl.skydrive_update"
TextType="SignIn" SessionChanged="btnSignin_SessionChanged"
Branding="Windows"/>
登录后台代码:
private void btnSignin_SessionChanged(object sender, LiveConnectSessionChangedEventArgs e)
{
if (e.Status == LiveConnectSessionStatus.Connected)
{
client = new LiveConnectClient(e.Session);
infoTextBlock.Text = "Signed in.";
client.GetCompleted +=
new EventHandler<LiveOperationCompletedEventArgs>(OnGetCompleted);
client.GetAsync("me", null);
for (var i = 0; i < this.ApplicationBar.Buttons.Count; i++)
{
var button = this.ApplicationBar.Buttons[i] as ApplicationBarIconButton;
if (button != null)
{
if (button.Text == "Upload")
{
button.IsEnabled = true;
}
}
}
}
else
{
infoTextBlock.Text = "Not signed in.";
client = null;
}
}
更新!
我一直在尝试,我仍然得到这个白色的屏幕。然而,我点击放大镜,然后点击后退箭头(它恢复),然后尝试再次登录,它的工作。那么这只是不吉利还是什么?
如果你在模拟器上,这可能是一个模拟器迟缓的问题;) – Typist