private void CompareDirectoriesFinnished(Task <Tuple <ObservableCollection <FileItem>, ObservableCollection <FileItem>, TimeSpan> > task) { Debug.Print("------ CompareDirectoriesFinnished"); progressTimer.Stop(); ViewModel.GuiFrozen = false; if (!BackgroundCompare.CompareCancelled) { LeftFolder.Init(); RightFolder.Init(); ViewModel.LeftFolder = task.Result.Item1; ViewModel.RightFolder = task.Result.Item2; Statusbar.Text = $"Compare time {TimeSpanToShortString(task.Result.Item3)}"; folderDiffItems = new List <FileItem>(); GetFolderDiffItems(ViewModel.RightFolder, folderDiffItems); } else { ViewModel.LeftFile = new ObservableCollection <Line>(); ViewModel.RightFile = new ObservableCollection <Line>(); Statusbar.Text = $"Compare cancelled"; } LeftFolder.Focus(); }
private void CommandNextFile_Executed(object sender, ExecutedRoutedEventArgs e) { if (folderDiffItems.Count > 0) { int currentIndex = folderDiffItems.IndexOf(RightFolder.SelectedFile); if (currentIndex == -1) { RightFolder.Select(folderDiffItems[0]); } else if (currentIndex < folderDiffItems.Count - 1) { RightFolder.Select(folderDiffItems[currentIndex + 1]); } } }