Selaa lähdekoodia

综合-注释

OYXH\oyxh 2 vuotta sitten
vanhempi
commit
f8a554a2ce

+ 2 - 2
PDF Office/ViewModels/PropertyPanel/AnnotPanel/FreetextAnnotPropertyViewModel.cs

@@ -329,8 +329,8 @@ namespace PDF_Master.ViewModels.PropertyPanel.AnnotPanel
             if (FontVm.CurrentFontSize != null)
             {
                 PropertyPanel.UpdateAnnotAAttrib(AnnotAttrib.FontSize, FontVm.CurrentFontSize.Value);
-                if (BasicVm.IsMultiSelected == false)
-                    PropertyPanel.InvokeToMyTools(BasicVm.AnnotType, Annot);
+                //if (BasicVm.IsMultiSelected == false)
+                //    PropertyPanel.InvokeToMyTools(BasicVm.AnnotType, Annot);
             }
         }
 

+ 20 - 24
PDF Office/ViewModels/Tools/AnnotToolContentViewModel.Command.cs

@@ -1,34 +1,30 @@
-using ComPDFKit.PDFAnnotation;
-using ComPDFKit.PDFDocument.Action;
+using ComPDFKit.Import;
+using ComPDFKit.PDFAnnotation;
 using ComPDFKit.PDFDocument;
+using ComPDFKit.PDFDocument.Action;
 using ComPDFKitViewer;
 using ComPDFKitViewer.AnnotEvent;
 using ComPDFKitViewer.PdfViewer;
 using PDF_Master.CustomControl;
 using PDF_Master.EventAggregators;
 using PDF_Master.Helper;
+using PDF_Master.Model.AnnotPanel;
 using PDF_Master.Properties;
 using PDF_Master.ViewModels.BOTA;
+using PDF_Master.ViewModels.Tools.AnnotManager;
 using PDF_Master.Views.BOTA;
 using PDFSettings;
 using Prism.Mvvm;
 using Prism.Regions;
 using System;
 using System.Collections.Generic;
+using System.Diagnostics;
 using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
 using System.Windows;
 using System.Windows.Controls;
 using System.Windows.Controls.Primitives;
-using System.Windows.Media;
-using System.Diagnostics;
-using PDF_Master.Model.AnnotPanel;
 using System.Windows.Input;
-using PDF_Master.ViewModels.Tools.AnnotManager;
-using ComPDFKit.Import;
-using System.Windows.Markup;
-using ImTools;
+using System.Windows.Media;
 
 namespace PDF_Master.ViewModels.Tools
 {
@@ -374,7 +370,7 @@ namespace PDF_Master.ViewModels.Tools
                             switch (annot.EventType)
                             {
                                 case AnnotArgsType.AnnotFreeText:
-                                    GetFreetext(e.AnnotItemsList);
+                                    annot = GetFreetext(e.AnnotItemsList);
                                     PDFViewer.SetToolParam(annot);
                                     break;
 
@@ -873,14 +869,14 @@ namespace PDF_Master.ViewModels.Tools
                     {
                         case ActionType.Add:
 
-                            if (editEvent.EditAnnotArgs is StickyAnnotArgs stickyAnnotArgs)
-                            {
-                                PDFViewer.SelectAnnotation(stickyAnnotArgs.PageIndex, stickyAnnotArgs.AnnotIndex);
-                            }
-                            if (editEvent.EditAnnotArgs is FreeTextAnnotArgs freeTextAnnotArgs)
-                            {
-                                PDFViewer.SelectAnnotation(freeTextAnnotArgs.PageIndex, freeTextAnnotArgs.AnnotIndex);
-                            }
+                            //if (editEvent.EditAnnotArgs is StickyAnnotArgs stickyAnnotArgs)
+                            //{
+                            //    PDFViewer.SelectAnnotation(stickyAnnotArgs.PageIndex, stickyAnnotArgs.AnnotIndex);
+                            //}
+                            //if (editEvent.EditAnnotArgs is FreeTextAnnotArgs freeTextAnnotArgs)
+                            //{
+                            //    PDFViewer.SelectAnnotation(freeTextAnnotArgs.PageIndex, freeTextAnnotArgs.AnnotIndex);
+                            //}
                             //BOTA
                             bool isTabItemAnnotation = IsBOTATabItemShow(out BOTAContentViewModel bOTAContentViewModel, out BOTAContent bOTAContent, "TabItemAnnotation");
 
@@ -902,10 +898,10 @@ namespace PDF_Master.ViewModels.Tools
                                 AddAnnotSignature(editEvent.EditAnnotArgs);
                             }
 
-                            if (editEvent.EditAnnotArgs.EventType == AnnotArgsType.AnnotFreeText)
-                            {
-                                (editEvent.EditAnnotArgs as FreeTextAnnotArgs).LineWidth = 0;
-                            }
+                            //if (editEvent.EditAnnotArgs.EventType == AnnotArgsType.AnnotFreeText)
+                            //{
+                            //    (editEvent.EditAnnotArgs as FreeTextAnnotArgs).LineWidth = 0;
+                            //}
 
                             break;
 

+ 13 - 0
PDF Office/ViewModels/Tools/AnnotToolContentViewModel.cs

@@ -1036,6 +1036,19 @@ namespace PDF_Master.ViewModels.Tools
                         FreeTextDefalut.BackgroundColor = freeText.BgColor;
                         FreeTextDefalut.Opacity = (annot as FreeTextAnnotArgs).Transparency;
                         SettingHelper.SetAnnotDefaultProperty(FreeTextDefalut);
+                        FreeTextAnnotArgs freeTextAnnotArgs = new FreeTextAnnotArgs()
+                        {
+                            FontColor = freeText.FontColor,
+                            FontFamily = freeText.FontFamily,
+                            Align = freeText.Align,
+                            FontSize = freeText.FontSize,
+                            FontWeight = freeText.FontWeight,
+                            FontStyle = freeText.FontStyle,
+                            BgColor = freeText.BgColor,
+                            Transparency = (annot as FreeTextAnnotArgs).Transparency
+                        };
+
+                        PDFViewer.SetToolParam(freeTextAnnotArgs);
                     }
                     else if (annot is StickyAnnotArgs)
                     {