private async void delete_click(object sender, RoutedEventArgs e) { try{ DirectoryData datacontext = (DirectoryData)(e.OriginalSource as FrameworkElement).DataContext; if (datacontext.DirType == "Folder") { StorageFolder storfile = await storage.GetFolderAsync(datacontext.DirName); await storfile.DeleteAsync(); get_directories(storage); error.Text = ""; } }catch (Exception exception) { error.Text = "Can not delete folder!"; } }
private async void folder_click(object sender, DoubleTappedRoutedEventArgs e) { DirectoryData mf = (DirectoryData)listView.SelectedItem; if (mf.DirName == "..") { if (prevFolders.Count != 0) { storage = prevFolders[prevFolders.Count - 1]; get_directories(storage); prevFolders.RemoveAt(prevFolders.Count - 1); } } else if (mf.DirType == "Folder") { prevFolders.Add(storage); storage = await storage.GetFolderAsync(mf.DirName); get_directories(storage); } }