Browse Source

综合-去掉 免费用户 限制只选两个文件的逻辑;缩略图 点击空白取消选中

OYXH\oyxh 1 year ago
parent
commit
94d7d8eecf

+ 8 - 6
PDF Office/ViewModels/Dialog/ToolsDialogs/MergeDialogViewModel.cs

@@ -679,17 +679,19 @@ namespace PDF_Master.ViewModels.Dialog.ToolsDialogs
             {
                 return;
             }
-            if (Settings.Default.UserDate.subscribestatus != 1 && MergeObjectlist.Count >= 2)
-            {
-                return;
-            }
+            // 免费用户 限制只选两个文件的逻辑
+            //if (Settings.Default.UserDate.subscribestatus != 1 && MergeObjectlist.Count >= 2)
+            //{
+            //    return;
+            //}
             bool showDialog = false;
             ProcessVisible = Visibility.Visible;
             MaxValue = FilePath.Length;
 
-            int sum = SetFilesLength(FilePath);
+            // 免费用户 限制只选两个文件的逻辑
+            //int sum = SetFilesLength(FilePath);
 
-            for (int i = 0; i < sum; i++)
+            for (int i = 0; i < FilePath.Length; i++)
             {
                 //加入异步语句,防止UI卡死,显示加载进度条
                 await System.Threading.Tasks.Task.Delay(1);

+ 15 - 3
PDF Office/Views/PageEdit/PageEditContent.xaml.cs

@@ -668,7 +668,11 @@ namespace PDF_Master.Views.PageEdit
                 startChoose = true;
                 if (ListPageEdit.SelectedItems.Count > 0)
                 {
-                    ListPageEdit.SelectedItems.Clear();
+                    // 缩略图 点击空白取消选中
+                    if (GridBOTAHeader.Visibility != Visibility.Visible)
+                    {
+                        ListPageEdit.SelectedItems.Clear();
+                    }
                 }
                 starPosition = e.GetPosition(ListPageEdit);
                 starPosition = new Point(starPosition.X, starPosition.Y + GetWrapPanel(ListPageEdit).VerticalOffset);
@@ -747,6 +751,9 @@ namespace PDF_Master.Views.PageEdit
             RectChoose.Height = rec.Height;
             RectChoose.Visibility = Visibility.Visible;
 
+            Trace.WriteLine(rec.Width);
+            Trace.WriteLine(rec.Height);
+
             //检测遍历所有项,筛选在矩形框中的Item
             for (int i = 0; i < ListPageEdit.Items.Count; i++)
             {
@@ -754,8 +761,9 @@ namespace PDF_Master.Views.PageEdit
                 //通过这一步来避免重复误选中
                 var parent = CommonHelper.FindVisualParent<VirtualizingWrapPanel>(_item);
                 if (parent == null)
+                {
                     continue;
-
+                }
                 var v = VisualTreeHelper.GetOffset(_item);
                 if (rec.IntersectsWith(new Rect(v.X, v.Y, _item.ActualWidth, _item.ActualHeight)))
                 {
@@ -763,7 +771,11 @@ namespace PDF_Master.Views.PageEdit
                 }
                 else
                 {
-                    ListPageEdit.SelectedItems.Remove(ListPageEdit.Items[i]);
+                    // 缩略图 点击空白取消选中
+                    if (GridBOTAHeader.Visibility != Visibility.Visible)
+                    {
+                        ListPageEdit.SelectedItems.Remove(ListPageEdit.Items[i]);
+                    }
                 }
             }
             return;