private async Task NavigateBackGraphAsync() { if (_graphCurrentFolder != null) { Toolkit.Services.OneDrive.OneDriveStorageFolder currentFolder = null; progressRing.IsActive = true; try { if (!string.IsNullOrEmpty(_graphCurrentFolder.Path)) { currentFolder = await _graphRootFolder.GetFolderAsync(_graphCurrentFolder.Path); } else { currentFolder = _graphRootFolder; } LstFolder.ItemsSource = await currentFolder.GetFoldersAsync(100); _graphCurrentFolder = currentFolder; } catch (ServiceException ex) { await OneDriveSampleHelpers.DisplayOneDriveServiceExceptionAsync(ex); } finally { progressRing.IsActive = false; } } }
public static async Task <Toolkit.Services.OneDrive.OneDriveStorageFolder> OpenFolderPicker(string title, Toolkit.Services.OneDrive.OneDriveStorageFolder rootFolder) { FoldersPickerControl folderPicker = new FoldersPickerControl(await rootFolder.GetFoldersAsync(100), rootFolder); ContentDialog dialog = new ContentDialog { Content = folderPicker, Title = title, PrimaryButtonText = "Ok" }; if (await dialog.ShowAsync() == ContentDialogResult.Primary) { return(folderPicker.SelectedGraphFolder); } else { return(null); } }