Bläddra i källkod

便签 - 便签弹窗

chenrongqian@kdanmobile.com 1 år sedan
förälder
incheckning
b6c69d7a67
1 ändrade filer med 27 tillägg och 0 borttagningar
  1. 27 0
      PDF Office/Views/PropertyPanel/AnnotPanel/StickyNotePopup.xaml.cs

+ 27 - 0
PDF Office/Views/PropertyPanel/AnnotPanel/StickyNotePopup.xaml.cs

@@ -2,6 +2,7 @@
 using ComPDFKitViewer.AnnotEvent;
 using ComPDFKitViewer.PdfViewer;
 using PDF_Master.CustomControl.CompositeControl;
+using PDF_Master.Properties;
 using PDF_Master.ViewModels.PropertyPanel.AnnotPanel;
 using System;
 using System.Collections.Generic;
@@ -115,6 +116,24 @@ namespace PDF_Master.Views.PropertyPanel.AnnotPanel
             ContentText.Focus();
             ContentText.CaretIndex = ContentText.Text.Length;
             LoadedColor();
+            if(GetPDFViewer != null)
+            {
+                GetPDFViewer.PreviewMouseLeftButtonDown -= GetPDFViewer_LeftButtonDown;
+                GetPDFViewer.PreviewMouseLeftButtonDown += GetPDFViewer_LeftButtonDown;
+            }
+        }
+
+        private void GetPDFViewer_LeftButtonDown(object sender, MouseButtonEventArgs e)
+        {
+            var ui = e.OriginalSource as FrameworkElement;
+            if(ui != null)
+            {
+                if(ui.DataContext != null && ui.DataContext is ColorItem == false)
+                {
+                    CloseText_MouseUp(this, null);
+                    GetPDFViewer.PreviewMouseLeftButtonDown -= GetPDFViewer_LeftButtonDown;
+                }
+            }
         }
 
         public void LoadedColor()
@@ -341,6 +360,14 @@ namespace PDF_Master.Views.PropertyPanel.AnnotPanel
         {
             base.SetStickyNote(note);
             StickyText = note;
+            try
+            {
+                ContentText.FontFamily = new FontFamily(Settings.Default.AppProperties.Annotate.AnchoredFamaily);
+            }
+            catch (Exception ex)
+            {
+
+            }
         }
 
         public override void SetReadOnly(bool readOnly)