Пример #1
0
        private async void create_folder(object sender, RoutedEventArgs e)
        {
            try
            {
                string NewName = folderName_tb.Text;
                await folder_handler.Root().CreateFolderAsync(NewName);

                folder_handler.PopulateViewList();
                listView.ItemsSource = folder_handler.ViewContentList;
                Error_tb.Text        = "";
            }
            catch (Exception)
            {
                Error_tb.Text = "Can't add folder.";
            }
        }
Пример #2
0
        private async void open_folder(object sender, RoutedEventArgs e)
        {
            var folderPicker = new FolderPicker
            {
                SuggestedStartLocation = PickerLocationId.Desktop
            };

            folderPicker.FileTypeFilter.Add("*");

            StorageFolder folder = await folderPicker.PickSingleFolderAsync();

            if (folder != null)
            {
                Windows.Storage.AccessCache.StorageApplicationPermissions.
                FutureAccessList.AddOrReplace("PickedFolderToken", folder);
                folder_handler = new FolderData(folder);
                folder_handler.PopulateViewList();
                listView.ItemsSource = folder_handler.ViewContentList;
            }
        }