private void DeleteFile() { if (SelectedItems != null) { var item = SelectedItems.FirstOrDefault(); if (item != null && File.Exists(item.Path)) { File.Delete(item.Path); CurrentFolderItems.Remove(item); } } }
protected void ParrentFolder() { if (!String.IsNullOrEmpty(CurrentPath)) { string[] path = CurrentPath.Split('\\'); if (path.Length <= 2 && path.Any(i => String.IsNullOrEmpty(i))) { CurrentFolderItems.Clear(); DirectoryItemVM item = Items.FirstOrDefault(i => i.Name == $"{path.FirstOrDefault()}\\"); item.ClearChildren(); } var parrent = Directory.GetParent(CurrentPath); if (parrent != null) { CurrentPath = parrent.FullName; } } }