コード例 #1
0
        private bool OnScrollDownCmdCanExecute()
        {
            bool canExecute = false;

            if (PdfFiles.Count > 1 &&
                SelectedFile != null &&
                PdfFiles.IndexOf(SelectedFile) < PdfFiles.Count - 1)
            {
                canExecute = true;
            }
            return(canExecute);
        }
コード例 #2
0
 private bool OnMoveDownCmdCanExecute()
 {
     if (!IsBusy &&
         SelectedFile != null &&
         PdfFiles.IndexOf(SelectedFile) < PdfFiles.Count - 1)
     {
         return(true);
     }
     else
     {
         return(false);
     }
 }
コード例 #3
0
        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;
        }
コード例 #4
0
        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;
            }
        }
コード例 #5
0
        private void OnScrollDownCmdExecute()
        {
            int index = PdfFiles.IndexOf(SelectedFile);

            SelectedFile = PdfFiles.ElementAt(++index);
        }