Explorar o código

便签 - 便签弹窗

chenrongqian@kdanmobile.com hai 1 ano
pai
achega
b6c69d7a67

+ 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)