瀏覽代碼

综合-页面编辑 右键选中,bota 缩略图 右键不选中也不跳转

OYXH\oyxh 1 年之前
父節點
當前提交
edd76f27c3

+ 5 - 5
PDF Office/ViewModels/PageEdit/PageEditContentViewModel.cs

@@ -661,11 +661,11 @@ namespace PDF_Master.ViewModels.PageEdit
 
 
             SplitCommand = new DelegateCommand(SplitCommandEvent);
             SplitCommand = new DelegateCommand(SplitCommandEvent);
             InsertCommand = new DelegateCommand<object>(InsertCommandEvent);
             InsertCommand = new DelegateCommand<object>(InsertCommandEvent);
-            ReplaceCommand = new DelegateCommand(ReplaceCommandEvent, CanFileCommandExcute).ObservesProperty(() => ListSelectedIndex);
-            ExtractCommand = new DelegateCommand(ExtractCommandEvent, CanFileCommandExcute).ObservesProperty(() => ListSelectedIndex);
-            DeleteCommand = new DelegateCommand(DeleteCommandEvent, CanFileCommandExcute).ObservesProperty(() => ListSelectedIndex);
-            LeftRotateCommand = new DelegateCommand(LeftRotateCommandEvent, CanFileCommandExcute).ObservesProperty(() => ListSelectedIndex);
-            RightRotateCommand = new DelegateCommand(RightRotateCommandEvent, CanFileCommandExcute).ObservesProperty(() => ListSelectedIndex);
+            ReplaceCommand = new DelegateCommand(ReplaceCommandEvent, CanFileCommandExcute).ObservesProperty(() => IsMouseRightButtonDown);
+            ExtractCommand = new DelegateCommand(ExtractCommandEvent, CanFileCommandExcute).ObservesProperty(() => IsMouseRightButtonDown);
+            DeleteCommand = new DelegateCommand(DeleteCommandEvent, CanFileCommandExcute).ObservesProperty(() => IsMouseRightButtonDown);
+            LeftRotateCommand = new DelegateCommand(LeftRotateCommandEvent, CanFileCommandExcute).ObservesProperty(() => IsMouseRightButtonDown);
+            RightRotateCommand = new DelegateCommand(RightRotateCommandEvent, CanFileCommandExcute).ObservesProperty(() => IsMouseRightButtonDown);
             ReverseCommand = new DelegateCommand(ReverseCommandEvent, CanReverseFileCommandExcute).ObservesProperty(() => IsMultiSelected);
             ReverseCommand = new DelegateCommand(ReverseCommandEvent, CanReverseFileCommandExcute).ObservesProperty(() => IsMultiSelected);
             ZoomInCommand = new DelegateCommand(ZoomInCommandEvent, CanZoomIn).ObservesProperty(() => ZoomIndex);
             ZoomInCommand = new DelegateCommand(ZoomInCommandEvent, CanZoomIn).ObservesProperty(() => ZoomIndex);
             ZoomOutCommand = new DelegateCommand(ZoomOutCommandEvent, CanZoomOut).ObservesProperty(() => ZoomIndex);
             ZoomOutCommand = new DelegateCommand(ZoomOutCommandEvent, CanZoomOut).ObservesProperty(() => ZoomIndex);

+ 10 - 8
PDF Office/Views/PageEdit/PageEditContent.xaml.cs

@@ -606,21 +606,23 @@ namespace PDF_Master.Views.PageEdit
         /// <param name="e"></param>
         /// <param name="e"></param>
         private void ListPageEdit_PreviewMouseLeftButtonDown(object sender, MouseButtonEventArgs e)
         private void ListPageEdit_PreviewMouseLeftButtonDown(object sender, MouseButtonEventArgs e)
         {
         {
-            viewModel.IsMouseRightButtonDown = false;
-            viewModel.RightSelectedIndex = -1;
-            viewModel.RightSelectedIndexs.Clear();
-
             var pos = e.GetPosition(ListPageEdit);
             var pos = e.GetPosition(ListPageEdit);
             HitTestResult result = VisualTreeHelper.HitTest(ListPageEdit, pos);
             HitTestResult result = VisualTreeHelper.HitTest(ListPageEdit, pos);
             if (result == null)
             if (result == null)
             {
             {
                 return;
                 return;
             }
             }
+
             //未选中item  并且不是点击滑轨时 开始框选
             //未选中item  并且不是点击滑轨时 开始框选
             var listBoxItem = CommonHelper.FindVisualParent<ListBoxItem>(result.VisualHit);
             var listBoxItem = CommonHelper.FindVisualParent<ListBoxItem>(result.VisualHit);
             var scroller = CommonHelper.FindVisualParent<ScrollBar>(result.VisualHit);
             var scroller = CommonHelper.FindVisualParent<ScrollBar>(result.VisualHit);
             if (listBoxItem == null)
             if (listBoxItem == null)
             {
             {
+                viewModel.IsMouseRightButtonDown = true;
+                viewModel.IsMouseRightButtonDown = false;
+                viewModel.RightSelectedIndex = -1;
+                viewModel.RightSelectedIndexs.Clear();
+
                 if (scroller != null)
                 if (scroller != null)
                 {
                 {
                     startChoose = false;
                     startChoose = false;
@@ -1113,10 +1115,10 @@ namespace PDF_Master.Views.PageEdit
                 }
                 }
                 else
                 else
                 {
                 {
-                    
-                    if (viewModel.RightSelectedIndex != viewModel.ListSelectedIndex)
+                    //页面编辑 右键选中,bota 缩略图 右键不选中也不跳转
+                    viewModel.ListSelectedIndex = viewModel.RightSelectedIndex;
+                    if (viewModel.IsBOTAThumb == Visibility.Visible)
                     {
                     {
-                        viewModel.ListSelectedIndex = viewModel.RightSelectedIndex;
                         viewModel.ListSelectedIndex = -1;
                         viewModel.ListSelectedIndex = -1;
                     }
                     }
 
 
@@ -1132,7 +1134,7 @@ namespace PDF_Master.Views.PageEdit
         private void ListBoxItem_PreviewMouseLeftButtonDown(object sender, MouseButtonEventArgs e)
         private void ListBoxItem_PreviewMouseLeftButtonDown(object sender, MouseButtonEventArgs e)
         {
         {
             //viewModel.IsAddPages = false;
             //viewModel.IsAddPages = false;
-
+            viewModel.IsMouseRightButtonDown = true;
             viewModel.IsMouseRightButtonDown = false;
             viewModel.IsMouseRightButtonDown = false;
             viewModel.RightSelectedIndex = -1;
             viewModel.RightSelectedIndex = -1;
             viewModel.RightSelectedIndexs.Clear();
             viewModel.RightSelectedIndexs.Clear();