瀏覽代碼

便签 - 便签弹窗

chenrongqian@kdanmobile.com 1 年之前
父節點
當前提交
b6c69d7a67
共有 1 個文件被更改,包括 27 次插入0 次删除
  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)