|
@@ -1,4 +1,5 @@
|
|
|
-using System.Windows;
|
|
|
+using PDF_Master.Views.HomePanel.RecentFiles;
|
|
|
+using System.Windows;
|
|
|
using System.Windows.Controls;
|
|
|
using System.Windows.Input;
|
|
|
using System.Windows.Media;
|
|
@@ -45,6 +46,38 @@ namespace PDF_Master.Views.HomePanel
|
|
|
if (foundChild != null) break;
|
|
|
}
|
|
|
return foundChild;
|
|
|
- }
|
|
|
+ }
|
|
|
+
|
|
|
+ private void Recentlist_MouseDown(object sender, MouseButtonEventArgs e)
|
|
|
+ {
|
|
|
+ //Windows:最近文件列表补充点击空白处取消选中;移除Esc取消选中逻辑
|
|
|
+ if (sender is RecentFilesContent recentFilesContent)
|
|
|
+ {
|
|
|
+ if (recentFilesContent.GridRecentFilesList.Visibility == Visibility.Visible)
|
|
|
+ {
|
|
|
+ var point = e.GetPosition(recentFilesContent.GridRecentFilesList);
|
|
|
+ var result = VisualTreeHelper.HitTest(recentFilesContent.GridRecentFilesList, point);
|
|
|
+ if (result != null)
|
|
|
+ {
|
|
|
+ if (recentFilesContent.GridRecentFilesList.SelectedIndex != -1)
|
|
|
+ {
|
|
|
+ recentFilesContent.GridRecentFilesList.SelectedIndex = -1;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ else if (recentFilesContent.RecentFilesList.Visibility == Visibility.Visible)
|
|
|
+ {
|
|
|
+ var point = e.GetPosition(recentFilesContent.RecentFilesList);
|
|
|
+ var result = VisualTreeHelper.HitTest(recentFilesContent.RecentFilesList, point);
|
|
|
+ if (result != null)
|
|
|
+ {
|
|
|
+ if (recentFilesContent.RecentFilesList.SelectedIndex != -1)
|
|
|
+ {
|
|
|
+ recentFilesContent.RecentFilesList.SelectedIndex = -1;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
-}
|
|
|
+}
|