private async Task NavigateBackAsync()
        {
            if (_currentFolder != null)
            {
                OneDriveStorageFolder currentFolder = null;
                progressRing.IsActive = true;
                try
                {
                    if (!string.IsNullOrEmpty(_currentFolder.Path))
                    {
                        currentFolder = await _rootFolder.GetFolderAsync(_currentFolder.Path);
                    }
                    else
                    {
                        currentFolder = _rootFolder;
                    }

                    LstFolder.ItemsSource = await currentFolder.GetFoldersAsync(100);

                    _currentFolder = currentFolder;
                }
                catch (ServiceException ex)
                {
                    await OneDriveSampleHelpers.DisplayOneDriveServiceExceptionAsync(ex);
                }
                finally
                {
                    progressRing.IsActive = false;
                }
            }
        }
Example #2
0
        public static async Task <OneDriveStorageFolder> OpenFolderPicker(string title, OneDriveStorageFolder rootFolder)
        {
            FoldersPickerControl folderPicker = new FoldersPickerControl(await rootFolder.GetFoldersAsync(100), rootFolder);

            ContentDialog dialog = new ContentDialog();

            dialog.Content           = folderPicker;
            dialog.Title             = title;
            dialog.PrimaryButtonText = "Ok";

            if (await dialog.ShowAsync() == ContentDialogResult.Primary)
            {
                return(folderPicker.SelectedFolder);
            }
            else
            {
                return(null);
            }
        }