Kaynağa Gözat

页面编辑 bug18827、18815、18814、18805、18801

OYXH\oyxh 1 yıl önce
ebeveyn
işleme
10d6b177d3

+ 8 - 7
PDF Office/ViewModels/PageEdit/PageEditContentViewModel.cs

@@ -1292,6 +1292,10 @@ namespace PDF_Master.ViewModels.PageEdit
                         index = index + 1;
                     }
                 }
+                else
+                {
+                    index = 0;
+                }
                 if (IsBOTAThumb == Visibility.Visible)
                 {
                     GoToPage(new List<int>() { index });
@@ -2325,7 +2329,7 @@ namespace PDF_Master.ViewModels.PageEdit
                     return index;
                 }
             }
-            bool isLast=false;
+            bool isLast = false;
             if (index == -1 && indexList.Count > 0)
             {
                 if (isMultiSelected)
@@ -2337,7 +2341,6 @@ namespace PDF_Master.ViewModels.PageEdit
                 {
                     index = indexList.Last();
                 }
-                
             }
             if (index == PageEditItems.Count)
             {
@@ -2345,16 +2348,15 @@ namespace PDF_Master.ViewModels.PageEdit
             }
             else if (index < PageEditItems.Count)
             {
-                if((index + 1)>= PageEditItems.Count)
+                if ((index + 1) >= PageEditItems.Count)
                 {
-                    pageEditItem = PageEditItems[PageEditItems.Count-1];
+                    pageEditItem = PageEditItems[PageEditItems.Count - 1];
                     isLast = true;
                 }
                 else
                 {
                     pageEditItem = PageEditItems[index + 1];
                 }
-               
             }
 
             var result = PDFViewer.Document.RemovePages(indexList.ToArray());
@@ -2381,10 +2383,9 @@ namespace PDF_Master.ViewModels.PageEdit
             index = PageEditItems.IndexOf(pageEditItem);
             if (index == -1 && indexList.Count > 0)
             {
-                
                 if (isLast)
                 {
-                    index = PageEditItems.Count-1;
+                    index = PageEditItems.Count - 1;
                 }
                 else
                 {

+ 11 - 10
PDF Office/Views/PageEdit/PageEditContent.xaml

@@ -425,17 +425,18 @@
                     Name="StkpnlRight"
                     HorizontalAlignment="Right"
                     Orientation="Horizontal">
-                    <Button Margin="4" Command="{Binding ZoomInCommand}">
+
+                    <Button Margin="4" Command="{Binding ZoomOutCommand}">
                         <Path
                             Width="28"
                             Height="28"
-                            Data="M20 12.5C20 16.0899 17.0899 19 13.5 19C9.91015 19 7 16.0899 7 12.5C7 8.91015 9.91015 6 13.5 6C17.0899 6 20 8.91015 20 12.5ZM18.2928 19.5209C16.9284 20.4541 15.2779 21 13.5 21C8.80558 21 5 17.1944 5 12.5C5 7.80558 8.80558 4 13.5 4C18.1944 4 22 7.80558 22 12.5C22 14.6954 21.1677 16.6965 19.8013 18.2048L23.4741 22.0603L22.026 23.4397L18.2928 19.5209ZM12.5 9V11.5H10V13.5H12.5V16H14.5V13.5H17V11.5H14.5V9H12.5Z" />
+                            Data="M20 12.5C20 16.0899 17.0899 19 13.5 19C9.91015 19 7 16.0899 7 12.5C7 8.91015 9.91015 6 13.5 6C17.0899 6 20 8.91015 20 12.5ZM18.2928 19.5209C16.9284 20.4541 15.2779 21 13.5 21C8.80558 21 5 17.1944 5 12.5C5 7.80558 8.80558 4 13.5 4C18.1944 4 22 7.80558 22 12.5C22 14.6954 21.1677 16.6965 19.8013 18.2048L23.4741 22.0603L22.026 23.4397L18.2928 19.5209ZM10 11.5H17V13.5H10V11.5Z" />
                     </Button>
-                    <Button Margin="4" Command="{Binding ZoomOutCommand}">
+                    <Button Margin="4" Command="{Binding ZoomInCommand}">
                         <Path
                             Width="28"
                             Height="28"
-                            Data="M20 12.5C20 16.0899 17.0899 19 13.5 19C9.91015 19 7 16.0899 7 12.5C7 8.91015 9.91015 6 13.5 6C17.0899 6 20 8.91015 20 12.5ZM18.2928 19.5209C16.9284 20.4541 15.2779 21 13.5 21C8.80558 21 5 17.1944 5 12.5C5 7.80558 8.80558 4 13.5 4C18.1944 4 22 7.80558 22 12.5C22 14.6954 21.1677 16.6965 19.8013 18.2048L23.4741 22.0603L22.026 23.4397L18.2928 19.5209ZM10 11.5H17V13.5H10V11.5Z" />
+                            Data="M20 12.5C20 16.0899 17.0899 19 13.5 19C9.91015 19 7 16.0899 7 12.5C7 8.91015 9.91015 6 13.5 6C17.0899 6 20 8.91015 20 12.5ZM18.2928 19.5209C16.9284 20.4541 15.2779 21 13.5 21C8.80558 21 5 17.1944 5 12.5C5 7.80558 8.80558 4 13.5 4C18.1944 4 22 7.80558 22 12.5C22 14.6954 21.1677 16.6965 19.8013 18.2048L23.4741 22.0603L22.026 23.4397L18.2928 19.5209ZM12.5 9V11.5H10V13.5H12.5V16H14.5V13.5H17V11.5H14.5V9H12.5Z" />
                     </Button>
                 </StackPanel>
             </Grid>
@@ -495,14 +496,14 @@
                 VirtualizingPanel.ScrollUnit="Pixel"
                 VirtualizingPanel.VirtualizationMode="Standard">
                 <!--
-                    VirtualizingPanel.IsVirtualizing="true"会加快item加载速度,但是会导致大量绑定失败,Debug时会比较卡顿。
-                    需要综合情况来看是否要启用虚拟化
+                VirtualizingPanel.IsVirtualizing="true"会加快item加载速度,但是会导致大量绑定失败,Debug时会比较卡顿。
+                需要综合情况来看是否要启用虚拟化
                 -->
                 <!--
-                    此处要用循环模式,否则滚动时容易误触发EndSscroll 从而频繁拿图导致卡顿
-                    VirtualizingPanel.ScrollUnit="Pixel" 设置鼠标每次滚动的步进值
-                    VirtualizingPanel.VirtualizationMode="Standard" ‚
-                    如果设置成循环模式,回导致偶现选中一页无法取消的情况
+                此处要用循环模式,否则滚动时容易误触发EndSscroll 从而频繁拿图导致卡顿
+                VirtualizingPanel.ScrollUnit="Pixel" 设置鼠标每次滚动的步进值
+                VirtualizingPanel.VirtualizationMode="Standard" ‚
+                如果设置成循环模式,回导致偶现选中一页无法取消的情况
                 -->
                 <ListBox.ItemContainerStyle>
                     <Style TargetType="{x:Type ListBoxItem}">

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

@@ -215,7 +215,6 @@ namespace PDF_Master.Views.PageEdit
                             }
                             if (ListPageEdit.SelectedItems.Count > 0)
                             {
-                                //页码 下拉框 ,选择全选页面、奇数、偶数等情况,偶现IsMultiSelected=false,这里先强制设置一下
                                 viewModel.RightSelectedIndex = index;
                                 viewModel.RightSelectedIndexs.Add(index);
                             }
@@ -241,7 +240,16 @@ namespace PDF_Master.Views.PageEdit
                     }
                     if (ListPageEdit.SelectedItems.Count > 0)
                     {
-                        viewModel.IsMultiSelected = true;
+                        if (ListPageEdit.SelectedItems.Count >= 2)
+                        {
+                            //页码 下拉框 ,选择全选页面、奇数、偶数等情况,偶现IsMultiSelected=false,这里先强制设置一下
+                            viewModel.IsMultiSelected = true;
+                        }
+                        else
+                        {
+                            viewModel.IsMultiSelected = false;
+                        }
+
                         viewModel.IsMouseRightButtonDown = false;
                         viewModel.IsMouseRightButtonDown = true;
                     }