diff --git a/XLAB/MainWindow.xaml b/XLAB/MainWindow.xaml
index fc38f60..691f0bb 100644
--- a/XLAB/MainWindow.xaml
+++ b/XLAB/MainWindow.xaml
@@ -356,10 +356,14 @@
+
diff --git a/XLAB/MainWindow.xaml.cs b/XLAB/MainWindow.xaml.cs
index 34caf09..dd9c154 100644
--- a/XLAB/MainWindow.xaml.cs
+++ b/XLAB/MainWindow.xaml.cs
@@ -35,6 +35,19 @@ namespace XLAB
}
}
+ private void DocumentLineRow_MouseDoubleClick(object sender, MouseButtonEventArgs e)
+ {
+ var row = sender as DataGridRow;
+ if (row == null)
+ {
+ return;
+ }
+
+ row.IsSelected = true;
+ row.Focus();
+ _viewModel.TryEditVerificationFromDoubleClick(row.Item as PsvDocumentLine);
+ }
+
private void DocumentGroupRow_PreviewMouseRightButtonDown(object sender, MouseButtonEventArgs e)
{
var row = sender as DataGridRow;
diff --git a/XLAB/MainWindowViewModel.cs b/XLAB/MainWindowViewModel.cs
index 3fcc0e5..a3f1ed1 100644
--- a/XLAB/MainWindowViewModel.cs
+++ b/XLAB/MainWindowViewModel.cs
@@ -54,6 +54,7 @@ namespace XLAB
AddDocumentCommand = new RelayCommand(delegate { AddDocument(); }, delegate { return !IsBusy && !ShowClosedDocuments; });
CloneLineVerificationCommand = new RelayCommand(delegate { CloneSelectedLineVerificationAsync(); }, delegate { return CanCloneSelectedLineVerification(); });
DeleteDocumentCommand = new RelayCommand(delegate { DeleteDocumentAsync(); }, delegate { return !IsBusy && SelectedDocument != null; });
+ DeleteSelectedLinesCommand = new RelayCommand(delegate { DeleteSelectedLinesAsync(); }, delegate { return CanDeleteSelectedLines(); });
DeleteSelectedGroupsCommand = new RelayCommand(delegate { DeleteSelectedGroupsAsync(); }, delegate { return CanDeleteSelectedGroups(); });
MarkLinePassedCommand = new RelayCommand(delegate { EditLineVerificationAsync(true); }, delegate { return CanEditSelectedLineVerification(); });
MarkLineRejectedCommand = new RelayCommand(delegate { EditLineVerificationAsync(false); }, delegate { return CanEditSelectedLineVerification(); });
@@ -140,6 +141,8 @@ namespace XLAB
public ICommand DeleteDocumentCommand { get; private set; }
+ public ICommand DeleteSelectedLinesCommand { get; private set; }
+
public ICommand DeleteSelectedGroupsCommand { get; private set; }
public string GroupDetailFilterText
@@ -389,6 +392,12 @@ namespace XLAB
&& GetDeleteTargetGroups().Count > 0;
}
+ private bool CanDeleteSelectedLines()
+ {
+ return CanModifySelectedDocument()
+ && GetDeleteTargetLines().Count > 0;
+ }
+
private bool CanPrintSelectedDocument()
{
return !IsBusy
@@ -509,6 +518,14 @@ namespace XLAB
return true;
}
+ private bool CanEditVerificationFromDoubleClick(PsvDocumentLine line)
+ {
+ return CanModifySelectedDocument()
+ && line != null
+ && line.IsPassed.HasValue
+ && HasVerificationData(line);
+ }
+
private List GetCheckedDocumentLines()
{
return DocumentLinesView.Cast