Ver código fonte

综合-修复部分页面编辑bug

ZhouJieSheng 2 anos atrás
pai
commit
419ed0dc10

+ 27 - 3
PDF Office/Model/PageEdit/PageEditItem.cs

@@ -1,4 +1,5 @@
-using Prism.Commands;
+using PDF_Office.Helper;
+using Prism.Commands;
 using Prism.Mvvm;
 using System;
 using System.Collections.Generic;
@@ -48,12 +49,25 @@ namespace PDF_Office.Model.PageEdit
         public Size Size
         {
             get { return size; }
-            set { size = value; 
+            set { size = value;
                 //if(Size.Width>0&&Size.Height>0)
                 //{
                 //    var heigit = size.Height * 208 / size.Width;
                 //    ItemSize = new Size(208,heigit);
                 //}
+                //再设置Size时 同步更新文件尺寸大小,以及设置页面方向
+                double width = CommonHelper.GetUnitsFromPageSize(value.Width);
+                double height = CommonHelper.GetUnitsFromPageSize(value.Height);
+                this.PageSize = $"{width.ToString("F0")}mm*{height.ToString("F0")} mm";
+
+                if(value.Width<value.Height)
+                {
+                    this.isVertical = true;
+                }
+                else
+                {
+                    this.isVertical = false;
+                }
             }
         }
 
@@ -144,9 +158,19 @@ namespace PDF_Office.Model.PageEdit
         /// </summary>
         public bool IsGetImage = false;
 
+
+
+        private bool isvertical = true;
         /// <summary>
         /// 是否是竖直的图
         /// </summary>
-        public bool isVertical = true;
+        public bool isVertical
+        {
+            get { return isvertical; }
+            set { 
+                isvertical = value;
+            }
+        }
+
     }
 }

+ 19 - 2
PDF Office/Model/SettingsDialog/AnnotateModel.cs

@@ -177,7 +177,7 @@ namespace PDF_Office.Model.SettingsDialog
 
         private void InitFromSettings()
         {
-            var annote = new AnnotatePropertyClass();
+            var annote = Settings.Default.AppProperties.Annotate;
             this.HighLightColor = annote.HighLightColor;
             this.UnderLineColor = annote.UnderLineColor;
             this.StrikethroughColor = annote.StrikethroughColor;
@@ -273,9 +273,26 @@ namespace PDF_Office.Model.SettingsDialog
             SaveDefaultAnnotSettings();
         }
 
+        /// <summary>
+        /// 重置
+        /// </summary>
         public void Reset()
         {
-            InitFromSettings();
+            var annote = new AnnotatePropertyClass();
+            this.HighLightColor = annote.HighLightColor;
+            this.UnderLineColor = annote.UnderLineColor;
+            this.StrikethroughColor = annote.StrikethroughColor;
+            this.FreeHandColor = annote.FreeHandColor;
+            this.TextAnnoteColor = annote.TextAnnoteColor;
+            this.NoteAnnoteColor = annote.NoteAnnoteColor;
+            this.RectangleBorderColor = annote.RectangleBorderColor;
+            this.RectangleFillColor = annote.RectangleFillColor;
+            this.CircleBorderColor = annote.CircleBorderColor;
+            this.CircleFillColor = annote.CircleFillColor;
+            this.LineColor = annote.LineColor;
+            this.TextFontFamaily = annote.TextFontFamaily;
+            this.AnchoredFamaily = annote.AnchoredFamaily;
+            this.TextAlign = annote.TextAlign;
         }
 
     }

+ 16 - 3
PDF Office/Model/SettingsDialog/DescriptionModel.cs

@@ -128,9 +128,23 @@ namespace PDF_Office.Model.SettingsDialog
             InitFromSettings();
         }
 
+        /// <summary>
+        /// 重置
+        /// </summary>
         public void Reset()
         {
-            InitFromSettings();
+            var description = new DescriptionPropertyClass();
+            this.OpenUnClosedFileWhenOpen = description.OpenUnClosedFileWhenOpen;
+            this.RecoveryViewWhenOpen = description.RecoveryViewWhenOpen;
+            this.FileCountInRecentFiles = description.FileCountInRecentFiles;
+            this.AutoSave = description.AutoSave;
+            this.AutoSaveInterval = description.AutoSaveInterval;
+            this.ShowSaveWhenClose = description.ShowSaveWhenClose;
+            this.NotShowSaveWhenClose = description.NotShowSaveWhenClose;
+
+            this.AutoScanImageFile = description.AutoScanImageFile;
+            this.TipScanImageFile = description.TipScanImageFile;
+            this.Author = description.Author;
         }
 
         /// <summary>
@@ -159,8 +173,7 @@ namespace PDF_Office.Model.SettingsDialog
         /// </summary>
         private void InitFromSettings()
         {
-            //var description = Settings.Default.AppProperties.Description;
-            var description = new DescriptionPropertyClass();
+            var description = Settings.Default.AppProperties.Description;
             this.OpenUnClosedFileWhenOpen = description.OpenUnClosedFileWhenOpen;
             this.RecoveryViewWhenOpen = description.RecoveryViewWhenOpen;
             this.FileCountInRecentFiles = description.FileCountInRecentFiles;

+ 15 - 3
PDF Office/Model/SettingsDialog/InitialVIewModel.cs

@@ -175,7 +175,7 @@ namespace PDF_Office.Model.SettingsDialog
 
         private void InitFromSettings()
         {
-            var view = new InitialVIewPropertyClass();
+            var view = Settings.Default.AppProperties.InitialVIew;
             this.PageView = view.PageView;
             this.ZoomMode = view.ZoomMode;
             this.NotShowBOTA = view.NotShowBOTA;
@@ -189,7 +189,6 @@ namespace PDF_Office.Model.SettingsDialog
             this.HighlightLink = view.HighlightLink;
             this.FormHighLightColor = view.FormHighLightColor;
             this.RequiredFieldsColor = view.RequiredFieldsColor;
-
         }
 
         public void Save()
@@ -213,7 +212,20 @@ namespace PDF_Office.Model.SettingsDialog
 
         public void Reset()
         {
-            InitFromSettings();
+            var view = new InitialVIewPropertyClass();
+            this.PageView = view.PageView;
+            this.ZoomMode = view.ZoomMode;
+            this.NotShowBOTA = view.NotShowBOTA;
+            this.RememberBOTA = view.RememberBOTA;
+            this.ShowOutLine = view.ShowOutLine;
+            this.AutoExpandProperty = view.AutoExpandProperty;
+            this.ClickOpenProperty = view.ClickOpenProperty;
+            this.BackGround = view.BackGround;
+            this.BackGroundInFulWindow = view.BackGroundInFulWindow;
+            this.HignlightForm = view.HignlightForm;
+            this.HighlightLink = view.HighlightLink;
+            this.FormHighLightColor = view.FormHighLightColor;
+            this.RequiredFieldsColor = view.RequiredFieldsColor;
         }
 
     }

+ 2 - 0
PDF Office/Views/HomePanel/PromotionContent.xaml

@@ -73,6 +73,7 @@
                                             </Trigger>
                                         </Style.Triggers>
                                         <EventSetter Event="PreviewMouseLeftButtonDown" Handler="FrameworkElement_PreviewMouseLeftButtonDown" />
+                                        <Setter Property="AllowDrop" Value="True" />
                                     </Style>
                                 </ListView.ItemContainerStyle>
                             </ListView>
@@ -111,6 +112,7 @@
                                             </Trigger>
                                         </Style.Triggers>
                                         <EventSetter Event="PreviewMouseLeftButtonDown" Handler="FrameworkElement_PreviewMouseLeftButtonDown" />
+                                        <Setter Property="AllowDrop" Value="True" />
                                     </Style>
                                 </ListView.ItemContainerStyle>
                             </ListView>