private bool OnScrollDownCmdCanExecute() { bool canExecute = false; if (PdfFiles.Count > 1 && SelectedFile != null && PdfFiles.IndexOf(SelectedFile) < PdfFiles.Count - 1) { canExecute = true; } return(canExecute); }
private bool OnMoveDownCmdCanExecute() { if (!IsBusy && SelectedFile != null && PdfFiles.IndexOf(SelectedFile) < PdfFiles.Count - 1) { return(true); } else { return(false); } }
private void MoveUpAndDown(int direction) { IsBusy = true; int index = PdfFiles.IndexOf(SelectedFile); App.Current.Dispatcher.Invoke(delegate { PdfFiles.Move(index, index + direction); }); //Needed to trigger Selection Changed event In datagrid SelectedFile = null; SelectedFile = PdfFiles[index + direction]; IsBusy = false; }
private void OnRemoveFileCmdExecute() { SelectedFile.Close(); int index = PdfFiles.IndexOf(SelectedFile); App.Current.Dispatcher.Invoke(delegate { PdfFiles.RemoveAt(index); }); if (PdfFiles.Count > index) { SelectedFile = PdfFiles[index]; } else if (PdfFiles.Any()) { SelectedFile = PdfFiles[index - 1]; } else { SelectedFile = null; } }
private void OnScrollDownCmdExecute() { int index = PdfFiles.IndexOf(SelectedFile); SelectedFile = PdfFiles.ElementAt(++index); }