Skip to content

Instantly share code, notes, and snippets.

@eternaltung
Created February 8, 2014 05:53
Show Gist options
  • Save eternaltung/8877222 to your computer and use it in GitHub Desktop.
Save eternaltung/8877222 to your computer and use it in GitHub Desktop.
private async void GetButton_Click(object sender, RoutedEventArgs e)
{
try
{
LiveOperationResult operationResult = await liveClient.GetAsync("me/skydrive/files");
List<object> data = (List<object>)operationResult.Result["data"];
FolderBox.Items.Clear();
foreach (dynamic item in data)
{
//將資料夾的ID記在Tag中方便做update和delete
FolderBox.Items.Add(new ListBoxItem()
{
Content = item.name,
Tag = item.id
});
}
}
catch (LiveConnectException ex)
{
MessageDialog msg = new MessageDialog(ex.Message);
msg.ShowAsync();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment