private void subfolder_click(object sender, DoubleTappedRoutedEventArgs e) { FolderContent subfolder = (FolderContent)listView.SelectedItem; if (folder_handler.SubfolderSearch(subfolder)) { folder_handler.PopulateViewList(); listView.ItemsSource = folder_handler.ViewContentList; } }
internal bool SubfolderSearch(FolderContent fc) { foreach (StorageFolder folder in folderList) { if (folder.Name == fc.Name) { root_folder = folder; return(true); } } return(false); }
private async void delete_click(object sender, RoutedEventArgs e) { try { FolderContent subfolder = (FolderContent)(e.OriginalSource as FrameworkElement).DataContext; if (subfolder.FileType == "Folder") { StorageFolder folder = await folder_handler.Root().GetFolderAsync(subfolder.Name); await folder.DeleteAsync(); folder_handler.PopulateViewList(); listView.ItemsSource = folder_handler.ViewContentList; Error_tb.Text = ""; } } catch (Exception) { Error_tb.Text = "Can't delete folder."; } }