Browse Source

手绘,便签,颜色联动问题

liyijie 1 year ago
parent
commit
d48cbb5246

+ 2 - 0
PDF Office/ViewModels/PropertyPanel/AnnotPanel/FreehandAnnotPropertyViewModel.cs

@@ -61,6 +61,8 @@ namespace PDF_Master.ViewModels.PropertyPanel.AnnotPanel
 
         public List<ComboDataItem> EraserSizeItems { get; protected set; }
 
+        public bool IsFirst = true;
+
         private AnnotCommon _basicVm = new AnnotCommon();
 
         public AnnotCommon BasicVm

+ 2 - 0
PDF Office/ViewModels/PropertyPanel/AnnotPanel/StickyNotePropertyViewModel.cs

@@ -27,6 +27,8 @@ namespace PDF_Master.ViewModels.PropertyPanel.AnnotPanel
         //外部UI引用
         public string strOtherTag { get; private set; }
 
+        public bool IsFirst=true;
+
         private double _transpent;
 
         public double Transpent

+ 7 - 2
PDF Office/Views/PropertyPanel/AnnotPanel/FreehandAnnotProperty.xaml.cs

@@ -1,4 +1,5 @@
-using PDF_Master.ViewModels.PropertyPanel.AnnotPanel;
+using ComPDFKitViewer;
+using PDF_Master.ViewModels.PropertyPanel.AnnotPanel;
 using System;
 using System.Collections.Generic;
 using System.Linq;
@@ -29,8 +30,12 @@ namespace PDF_Master.Views.PropertyPanel.AnnotPanel
 
         private void UserControl_Loaded(object sender, RoutedEventArgs e)
         {
-            if (ViewModel != null)
+            if (ViewModel != null && ViewModel.IsFirst)
+            {
+                ViewModel.IsFirst = false;
                 ViewModel.BasicVm.CurrentFontColor = App.Current.FindResource("color.sys.layout.divider.pen") as Brush;
+                ViewModel.BasicVm.FontColor = ViewModel.BasicVm.FontColor;
+            }
         }
     }
 }

+ 6 - 1
PDF Office/Views/PropertyPanel/AnnotPanel/StickyNoteProperty.xaml.cs

@@ -1,4 +1,5 @@
 using ComPDFKitViewer.AnnotEvent;
+using Microsoft.Office.Interop.Excel;
 using PDF_Master.ViewModels.PropertyPanel.AnnotPanel;
 using System;
 using System.Collections.Generic;
@@ -144,7 +145,11 @@ namespace PDF_Master.Views.PropertyPanel.AnnotPanel
                         ViewModel.ExmpleData = (Geometry)converter.ConvertFrom(datacomment);
                         break;
                 }
-                ViewModel.SharpCurrentColor = App.Current.FindResource("color.sys.layout.divider.note") as Brush;
+                if (ViewModel.IsFirst) { ViewModel.SharpCurrentColor = App.Current.FindResource("color.sys.layout.divider.note") as Brush;
+                    ViewModel.SharpColor = ViewModel.SharpColor;
+                    ViewModel.IsFirst = false;
+                }
+                
             }
 
           //  cusColor.SelectedColorHandler -= cusColor_SelectedColor;