private void SortLogFiles() { var key = CurrentFile?.FullPath; LogFiles.Clear(); LogFiles.AddRange(GetAllLogs(_folderFullPath)); if (key != null) { CurrentFile = LogFiles.Single(l => l.FullPath.Equals(key)); } }