|
@@ -7,6 +7,7 @@ using System.Linq;
|
|
|
using System.Windows;
|
|
|
using System.Windows.Controls;
|
|
|
using System.Windows.Data;
|
|
|
+using System.Windows.Input;
|
|
|
using Microsoft.Win32;
|
|
|
|
|
|
namespace Compdfkit_Tools.PDFControl
|
|
@@ -94,8 +95,15 @@ namespace Compdfkit_Tools.PDFControl
|
|
|
|
|
|
private void Remove_Click(object sender, RoutedEventArgs e)
|
|
|
{
|
|
|
+ if (FileDataGrid.SelectedItems.Count == 0)
|
|
|
+ {
|
|
|
+ FileInfoDataList.Clear();
|
|
|
+ OnPropertyChanged("FileNum");
|
|
|
+ return;
|
|
|
+ }
|
|
|
var selectedItems = FileDataGrid.SelectedItems;
|
|
|
var selectedItemsList = selectedItems.Cast<FileInfoData>().ToList();
|
|
|
+
|
|
|
foreach (var item in selectedItemsList)
|
|
|
{
|
|
|
FileInfoDataList.Remove(item);
|
|
@@ -107,5 +115,18 @@ namespace Compdfkit_Tools.PDFControl
|
|
|
{
|
|
|
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
|
|
|
}
|
|
|
+
|
|
|
+ private void FileDataGrid_SelectionChanged(object sender, SelectionChangedEventArgs e)
|
|
|
+ {
|
|
|
+ BtnRemove.Content = FileDataGrid.SelectedItems.Count > 0 ? "Remove" : "Remove All";
|
|
|
+ }
|
|
|
+
|
|
|
+ private void FileDataGrid_OnMouseLeftButtonUp(object sender, MouseButtonEventArgs e)
|
|
|
+ {
|
|
|
+ if (e.OriginalSource.GetType() != typeof(DataGridCell))
|
|
|
+ {
|
|
|
+ FileDataGrid.UnselectAll();
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
}
|