2012-11-09 89 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帳戶。

因此,請嘗試使用物理設備進行調試。這對我行得通。