using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
using Windows.UI.Xaml.Controls.Primitives;

namespace ControlExplorer
{
    public class OneDriveFolderPicker : PickerFlyoutBase
    {
        private OneDriveExplorer _explorer;

        public OneDriveFolderPicker(string accessToken)
        {
            _explorer = new OneDriveExplorer(accessToken);
        }
        protected override bool ShouldShowConfirmationButtons()
        {
            return false;
        }

        protected override Control CreatePresenter()
        {
            return _explorer;
        }

        public async Task<OneDriveFolder> PickFolderAsync(FrameworkElement placementTarget)
        {
            ShowAt(placementTarget);
            return await _explorer.GetOneDriveFolderAsync();
        }
    }
}
