Browse Source

便签 - 便签弹窗

chenrongqian@kdanmobile.com 1 năm trước cách đây
mục cha
commit
b6c69d7a67

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

@@ -2,6 +2,7 @@
 using ComPDFKitViewer.AnnotEvent;
 using ComPDFKitViewer.AnnotEvent;
 using ComPDFKitViewer.PdfViewer;
 using ComPDFKitViewer.PdfViewer;
 using PDF_Master.CustomControl.CompositeControl;
 using PDF_Master.CustomControl.CompositeControl;
+using PDF_Master.Properties;
 using PDF_Master.ViewModels.PropertyPanel.AnnotPanel;
 using PDF_Master.ViewModels.PropertyPanel.AnnotPanel;
 using System;
 using System;
 using System.Collections.Generic;
 using System.Collections.Generic;
@@ -115,6 +116,24 @@ namespace PDF_Master.Views.PropertyPanel.AnnotPanel
             ContentText.Focus();
             ContentText.Focus();
             ContentText.CaretIndex = ContentText.Text.Length;
             ContentText.CaretIndex = ContentText.Text.Length;
             LoadedColor();
             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()
         public void LoadedColor()
@@ -341,6 +360,14 @@ namespace PDF_Master.Views.PropertyPanel.AnnotPanel
         {
         {
             base.SetStickyNote(note);
             base.SetStickyNote(note);
             StickyText = note;
             StickyText = note;
+            try
+            {
+                ContentText.FontFamily = new FontFamily(Settings.Default.AppProperties.Annotate.AnchoredFamaily);
+            }
+            catch (Exception ex)
+            {
+
+            }
         }
         }
 
 
         public override void SetReadOnly(bool readOnly)
         public override void SetReadOnly(bool readOnly)