2012-11-09 88 views
2

有没有其他人有Windows Phone 8的SkyDrive API的问题?我升级我的Windows Phone 7的代码到Windows Phone 8。当我点击登录按钮(网盘),我得到了以下画面:skydrive api windows phone 8

enter image description here

此代码(从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; 
     } 
    } 

更新!

我一直在尝试,我仍然得到这个白色的屏幕。然而,我点击放大镜,然后点击后退箭头(它恢复),然后尝试再次登录,它的工作。那么这只是不吉利还是什么?

+1

如果你在模拟器上,这可能是一个模拟器迟缓的问题;) – Typist

回答

0

经过进一步的审查,我确信这是一个模拟器问题。如果我充分摆弄它,最终它会奏效。

0

我读到模拟器中无法使用LiveSDK,因为您在模拟器中没有MS帐户。

因此,请尝试使用物理设备进行调试。这对我行得通。