private void UpOneLevel_Click(object sender, RoutedEventArgs e) { if (currentPath.EndsWith(":")) { FileFolderList.Items.Clear(); DriveList.Focus(); DriveList.SelectedIndex = -1; SelectedPath.Text = ""; parentPath = ""; } else { if (currentPath.Contains("\\")) { currentPath = currentPath.Substring(0, currentPath.LastIndexOf('\\')); } ListFilesAndFolders(); } SelectedPath.Text = parentPath; }