Browse Source

填写签名-BUG

liyijie 1 year ago
parent
commit
aacb9d7f70

+ 120 - 79
PDF Office/ViewModels/FillAndSign/FillAndSignContentViewModel.cs

@@ -54,6 +54,7 @@ using System.Windows.Markup;
 using Prism.Services.Dialogs;
 using PDF_Master.ViewModels.Tools.AnnotManager;
 using PDF_Master.Model.FillAndSign;
+using System.Windows.Shapes;
 
 namespace PDF_Master.ViewModels.FillAndSign
 {
@@ -94,6 +95,25 @@ namespace PDF_Master.ViewModels.FillAndSign
             get { return _HookShapeIsCheck; }
             set { SetProperty(ref _HookShapeIsCheck, value); }
 
+        }
+        public Dictionary<string, List<List<Point>>> keyShape = new Dictionary<string, List<List<Point>>>();
+
+        private void InitkeyShape()
+        {
+
+            keyShape["HookShape"] = new List<List<Point>> { new List<Point> { new Point(2 ,12.2028), new Point(9.77817 ,19.981), new Point(22.5061 ,2.30333) } };
+            keyShape["ForkShape"] = new List<List<Point>> { new List<Point> { new Point(5,5), new Point(23,23)  }, new List<Point> { new Point(23, 5), new Point( 5,23) } };
+            keyShape["RectShape"] = new List<List<Point>> { new List<Point> { new Point(1.40002, 1.40002), new Point(20, 1.40002) }, new List<Point> { new Point(20, 1.40002), new Point(20, 20) }, new List<Point> { new Point(20, 20), new Point(1.40002, 20) }, new List<Point> { new Point(1.40002, 20), new Point(1.40002, 1.40002) } };
+            keyShape["LineShape"] = new List<List<Point>> { new List<Point> { new Point(3.19995, 14) ,new Point(25.127, 14) } };
+            keyShape["DotShape"] = new List<List<Point>> { new List<Point> { new Point(3.19995, 3.19995), new Point(3.19995, 3.19995) } };
+
+
+            //keyShape["HookShape"] = new List<List<Point>> { new List<Point> { new Point(0.599976, 7.0286), new Point(5.57775, 11.8), new Point(13.4, 1.40002) } };
+            //keyShape["ForkShape"] = new List<List<Point>> { new List<Point> { new Point(3.19995, 3.20001), new Point(12.8, 12.8) }, new List<Point> { new Point(12.8, 3.20001), new Point(3.20005, 12.8) } };
+            //keyShape["RectShape"] = new List<List<Point>> { new List<Point> { new Point(5, 5), new Point(28, 5) }, new List<Point> { new Point(28, 5), new Point(28, 27) }, new List<Point> { new Point(28, 27), new Point(5, 27) }, new List<Point> { new Point(5, 27), new Point(5, 5) } };
+            //keyShape["LineShape"] = new List<List<Point>> { new List<Point> { new Point(3.19995, 3.20001), new Point(28, 3.20001) } };
+            //keyShape["DotShape"] = new List<List<Point>> { new List<Point> { new Point(3.19995, 3.19995), new Point(3.19995, 3.19995) } };
+
         }
         #endregion
         public DelegateCommand<object> AnnotDefaultValue_MenuCommand { get; set; }
@@ -111,6 +131,7 @@ namespace PDF_Master.ViewModels.FillAndSign
         /// </summary>
         public Dictionary<string, string> btnToProperty = new Dictionary<string, string>();
 
+
         private IDialogService dialogs;
         #endregion
         string Unicode = "";
@@ -125,6 +146,7 @@ namespace PDF_Master.ViewModels.FillAndSign
             CheckCommand = new DelegateCommand<object>(CheckedEvent);
             ToolExpandDict.Add("Freetext", AnnotArgsType.AnnotFreeText);
             InitDictionary();
+            InitkeyShape();
             AnnotDefaultValue_MenuCommand = new DelegateCommand<object>(AnnotDefaultValues_Menu);
             AnnotColorPalette_MenuCommand = new DelegateCommand<object>(AnnotColorPalette_Menu);
             FreeTextFontFamily_MenuCommand = new DelegateCommand<object>(FreeTextFontFamily_Menu);
@@ -144,6 +166,10 @@ namespace PDF_Master.ViewModels.FillAndSign
 
         private void FromFillAndSign(FillAndSigntEventArgs obj)
         {
+            if (viewContentViewModel.CurrentBar != "TabItemAnnotation")
+            {
+                return;
+            }
             if (obj != null)
             {
                 if (string.IsNullOrEmpty(obj.Action) == false)
@@ -557,29 +583,29 @@ namespace PDF_Master.ViewModels.FillAndSign
                     break;
                 case "RbtnTick"://勾
                     Shape = "HookShape";
-                    ShapePoints = new List<List<Point>> { new List<Point> { new Point(0.599976, 7.0286), new Point(5.57775, 11.8), new Point(13.4, 1.40002) } };
+                    ShapePoints = keyShape[Shape];
                     annotArgs = GetStamp();
                     break;
                 case "RbtnFork"://叉
                     Shape = "ForkShape";
 
-                    ShapePoints = new List<List<Point>> { new List<Point> { new Point(3.19995, 3.20001), new Point(12.8, 12.8) }, new List<Point> { new Point(12.8, 3.20001), new Point(3.20005, 12.8) } };
+                    ShapePoints = keyShape[Shape];
                     annotArgs = GetStamp();
                     break;
                 case "RbtnRectangle"://矩形
                     Shape = "RectShape";
-                    ShapePoints = new List<List<Point>> { new List<Point> { new Point(5, 5), new Point(28, 5) }, new List<Point> { new Point(28, 5), new Point(28, 27) }, new List<Point> { new Point(28, 27), new Point(5, 27) }, new List<Point> { new Point(5, 27), new Point(5, 5) } };
+                    ShapePoints = keyShape[Shape];
                     annotArgs = GetStamp();
                     break;
                 case "RbtnLine"://下划线
                     Shape = "LineShape";
-                    ShapePoints = new List<List<Point>> { new List<Point> { new Point(3.19995, 3.20001), new Point(28, 3.20001) } };
+                    ShapePoints = keyShape[Shape];
                     annotArgs = GetStamp();
                     break;
                 case "RbtnPoint":
                     IsSignPoint = true;
                     Shape = "DotShape";
-                    ShapePoints = new List<List<Point>> { new List<Point> { new Point(3.19995, 3.19995), new Point(3.19995, 3.19995) } };
+                    ShapePoints = keyShape[Shape];
                     LineWidthMultiple = 5;
                     annotArgs = GetStamp();
                     break;
@@ -898,51 +924,53 @@ namespace PDF_Master.ViewModels.FillAndSign
 
                     foreach (var itemAnnot in annots)
                     {
-                        for (int j = 0; j < viewContentViewModel.FillAndSign.Count; j++)
-                        {
-                            //annotAttribsList = itemAnnot.GetAnnotAttrib();
-                            //annotAttribsList[AnnotAttrib.Width] = (itemAnnot as FreehandAnnotArgs).Width;
-                            //annotAttribsList[AnnotAttrib.Height] = (itemAnnot as FreehandAnnotArgs).Height;
-                            if (viewContentViewModel.FillAndSign[j].PageIndex == itemAnnot.PageIndex && viewContentViewModel.FillAndSign[j].AnnotIndex == itemAnnot.AnnotIndex)
-                            {
-                                FreehandAnnotArgs freehandArgs = null;
-                                freehandArgs = itemAnnot as FreehandAnnotArgs;
-                                annotAttribsList = itemAnnot.GetAnnotAttrib();
-                                annotAttribsList[AnnotAttrib.Color] = freehandArgs.InkColor;
-                                annotAttribsList[AnnotAttrib.Transparency] = freehandArgs.Transparency;
-                                annotAttribsList[AnnotAttrib.Thickness] = freehandArgs.LineWidth;
-                                annotAttribsList[AnnotAttrib.NoteText] = freehandArgs.Content;
-                                annotAttribsList[AnnotAttrib.Path] = freehandArgs.RawPointList;
-                                annotAttribsList[AnnotAttrib.Width] = freehandArgs.Width;
-                                annotAttribsList[AnnotAttrib.Height] = freehandArgs.Height;
-
-                            }
-                        }
+                        //for (int j = 0; j < viewContentViewModel.FillAndSign.Count; j++)
+                        //{
+                        //    //annotAttribsList = itemAnnot.GetAnnotAttrib();
+                        //    //annotAttribsList[AnnotAttrib.Width] = (itemAnnot as FreehandAnnotArgs).Width;
+                        //    //annotAttribsList[AnnotAttrib.Height] = (itemAnnot as FreehandAnnotArgs).Height;
+                        //    if (viewContentViewModel.FillAndSign[j].PageIndex == itemAnnot.PageIndex && viewContentViewModel.FillAndSign[j].AnnotIndex == itemAnnot.AnnotIndex)
+                        //    {
+                        //        FreehandAnnotArgs freehandArgs = null;
+                        //        freehandArgs = itemAnnot as FreehandAnnotArgs;
+                        //        annotAttribsList = itemAnnot.GetAnnotAttrib();
+                        //        annotAttribsList[AnnotAttrib.Color] = freehandArgs.InkColor;
+                        //        annotAttribsList[AnnotAttrib.Transparency] = freehandArgs.Transparency;
+                        //        annotAttribsList[AnnotAttrib.Thickness] = freehandArgs.LineWidth;
+                        //        annotAttribsList[AnnotAttrib.NoteText] = freehandArgs.Content;
+                        //        annotAttribsList[AnnotAttrib.Path] = freehandArgs.RawPointList;
+                        //        annotAttribsList[AnnotAttrib.Width] = freehandArgs.Width;
+                        //        annotAttribsList[AnnotAttrib.Height] = freehandArgs.Height;
+
+                        //    }
+                        //}
                         var eventitem = AnnotAttribEvent.GetAnnotAttribEvent(itemAnnot, annotAttribsList);
-                        propertyPanel.AnnotEvent.ClearChangeAttribute();
+                        eventitem.ClearChangeAttribute();
                         propertyPanel.AnnotEvents.Add(eventitem);
 
                     }
-                }
-                for (int j = 0; j < viewContentViewModel.FillAndSign.Count; j++)
-                {
-
-                    if (viewContentViewModel.FillAndSign[j].PageIndex == annots[0].PageIndex && viewContentViewModel.FillAndSign[j].AnnotIndex == annots[0].AnnotIndex)
-                    {
-                        FreehandAnnotArgs freehandArgs = null;
-                        freehandArgs = annots[0] as FreehandAnnotArgs;
-                        annotAttribsList = annots[0].GetAnnotAttrib();
-                        annotAttribsList[AnnotAttrib.Color] = freehandArgs.InkColor;
-                        annotAttribsList[AnnotAttrib.Transparency] = freehandArgs.Transparency;
-                        annotAttribsList[AnnotAttrib.Thickness] = freehandArgs.LineWidth;
-                        annotAttribsList[AnnotAttrib.NoteText] = freehandArgs.Content;
-                        annotAttribsList[AnnotAttrib.Path] = freehandArgs.RawPointList;
-                        annotAttribsList[AnnotAttrib.Width] = freehandArgs.Width;
-                        annotAttribsList[AnnotAttrib.Height] = freehandArgs.Height;
-                     
-                    }
-                }
-                propertyPanel.AnnotEvent = AnnotAttribEvent.GetAnnotAttribEvent(annots[0], annotAttribsList);
+                }
+                //for (int j = 0; j < viewContentViewModel.FillAndSign.Count; j++)
+                //{
+
+                //    //if (viewContentViewModel.FillAndSign[j].PageIndex == annots[0].PageIndex && viewContentViewModel.FillAndSign[j].AnnotIndex == annots[0].AnnotIndex)
+                //    //{
+                //    //    FreehandAnnotArgs freehandArgs = null;
+                //    //    freehandArgs = annots[0] as FreehandAnnotArgs;
+                //    //    annotAttribsList = annots[0].GetAnnotAttrib();
+                //    //    annotAttribsList[AnnotAttrib.Color] = freehandArgs.InkColor;
+                //    //    annotAttribsList[AnnotAttrib.Transparency] = freehandArgs.Transparency;
+                //    //    annotAttribsList[AnnotAttrib.Thickness] = freehandArgs.LineWidth;
+                //    //    annotAttribsList[AnnotAttrib.NoteText] = freehandArgs.Content;
+                //    //    annotAttribsList[AnnotAttrib.Path] = freehandArgs.RawPointList;
+                //    //    annotAttribsList[AnnotAttrib.Width] = freehandArgs.Width;
+                //    //    annotAttribsList[AnnotAttrib.Height] = freehandArgs.Height;
+
+                //    //}
+                //}
+                var eventitem1 = AnnotAttribEvent.GetAnnotAttribEvent(annots[0], annotAttribsList);
+                eventitem1.ClearChangeAttribute();
+                propertyPanel.AnnotEvent = eventitem1;
                 if (annots[0] is LinkAnnotArgs && annotAttribEvent != null)
                 {
                     propertyPanel.AnnotEvent = annotAttribEvent;
@@ -1282,7 +1310,7 @@ namespace PDF_Master.ViewModels.FillAndSign
             }
         }
 
-        private void PDFViewer_AnnotHoverHandler(object sender, AnnotHoverData e)
+        private async void  PDFViewer_AnnotHoverHandler(object sender, AnnotHoverData e)
         {
             if (e != null && e.DrawContext != null)
             {
@@ -1293,38 +1321,51 @@ namespace PDF_Master.ViewModels.FillAndSign
                     e.PaintRect.Height + 4);
                 Pen hoverPen = new Pen(new SolidColorBrush(Color.FromArgb(0xff, 0x11, 0x8A, 0xff)), 1);
                 hoverPen.DashStyle = DashStyles.Dash;
-                e.DrawContext?.DrawRectangle(null, hoverPen, hoverRect);
-
-                //Todo:目前ComPDFKit.Viewer没有e.Annot参数
-                //便签,显示ToolTip内容
-                //if (e.Annot != null && e.Annot.Type == C_ANNOTATION_TYPE.C_ANNOTATION_TEXT)
-                //{
-                //    if (PDFViewer.ToolTip == null)
-                //    {
-                //        var content = e.Annot.GetContent();
-                //        if (string.IsNullOrEmpty(content) == false)
-                //        {
-                //            ToolTip TipChild = new ToolTip();
-                //            TipChild.Style = App.Current.Resources["FlowToolTip"] as Style;
-                //            TipChild.MaxWidth = 246;
-                //            TipChild.Content = content;
-                //            TipChild.Visibility = Visibility.Visible;
-                //            TipChild.IsOpen = true;
-                //            TipChild.Placement = PlacementMode.Right;
-                //            var rec = e.Annot.GetRect();
-                //            TipChild.PlacementRectangle = new Rect(rec.left, rec.top, rec.right, rec.bottom);
-                //            TipChild.PlacementTarget = PDFViewer.Parent as ContentControl;
-                //            TipChild.Placement = PlacementMode.MousePoint;
-                //            PDFViewer.ToolTip = TipChild;
-                //            oldRect = hoverRect;
-                //            PDFViewer.MouseMove -= PDFViewer_MouseMove;
-                //            PDFViewer.MouseMove += PDFViewer_MouseMove;
-                //            return;
-                //        }
-
-                //    }
-
-                //}
+                e.DrawContext?.DrawRectangle(null, hoverPen, hoverRect);
+
+            ////Todo: 目前ComPDFKit.Viewer没有e.Annot参数
+            ////便签,显示ToolTip内容
+            //    if (e.Annot != null && e.Annot.Type == C_ANNOTATION_TYPE.C_ANNOTATION_INK)
+            //    {
+                    
+            //        {
+
+            //            var item = new ColorDropBoxPop();
+            //            //item.DataContext = (sender as Ellipse).DataContext;
+            //            item.ColorSelected -= AnnotMenu_ColorSelected;
+            //            item.ColorSelected += AnnotMenu_ColorSelected;
+
+            //            if (popup == null)
+            //            { popup = new System.Windows.Controls.Primitives.Popup(); }
+            //            else { popup.IsOpen = false; }
+
+            //            ContentControl window = null;
+            //            if (PDFViewer.Parent as ContentControl != null)
+            //                window = PDFViewer.Parent as ContentControl;
+            //            else
+            //                window = App.Current.MainWindow;
+
+            //            popup.Child = item;
+            //            popup.PlacementRectangle = new Rect(Mouse.GetPosition(window), new Size(item.Width, item.Height));
+            //            popup.Placement = System.Windows.Controls.Primitives.PlacementMode.MousePoint;
+            //            popup.PlacementTarget = window;
+            //            popup.IsOpen = true;
+
+            //            Window parentWnd = Window.GetWindow(App.Current.MainWindow);
+            //            if (parentWnd != null)
+            //            {
+            //                parentWnd.MouseDown -= parentWnd_MouseDown;
+            //                parentWnd.MouseDown += parentWnd_MouseDown;
+            //            }
+                       
+            //                while (popup!= null &&  popup.IsOpen)
+            //                await Task.Delay(20);
+
+            //            parentWnd.MouseDown -= parentWnd_MouseDown;
+            //            popup = null;
+            //        }
+
+            //    }
             }
 
             CloseAnnotToolTip();

+ 106 - 70
PDF Office/ViewModels/FillAndSign/PropertyPanel/ShapFillPropertyViewModel.cs

@@ -76,21 +76,21 @@ namespace PDF_Master.ViewModels.FillAndSign.PropertyPanel
             set
             {
                 SetProperty(ref selectColor, value);
-                if (!fillAndSignContentViewModel.isFirst)
-                {
-                    fillAndSignContentViewModel.SelectColor = value;
-                    //if (FillAndSignContentViewModel.IsEdit)
-                    {
-                        // PropertyPanel.UpdateAnnotAAttrib(AnnotAttrib.Thickness, LineWidth * lineWidthMultiple);
-                        PropertyPanel.UpdateAnnotAAttrib(AnnotAttrib.Color, (selectColor as SolidColorBrush).Color);
-                    }
-                    //else
-                    {
-                        if (IsFillAndSign) { fillAndSignContentViewModel.SetStamp(); }
-
-                    }
-
-                }
+                //if (!fillAndSignContentViewModel.isFirst)
+                //{
+                //    fillAndSignContentViewModel.SelectColor = value;
+                //    //if (FillAndSignContentViewModel.IsEdit)
+                //    {
+                //        // PropertyPanel.UpdateAnnotAAttrib(AnnotAttrib.Thickness, LineWidth * lineWidthMultiple);
+                //        PropertyPanel.UpdateAnnotAAttrib(AnnotAttrib.Color, (selectColor as SolidColorBrush).Color);
+                //    }
+                //    //else
+                //    {
+                //        if (IsFillAndSign) { fillAndSignContentViewModel.SetStamp(); }
+
+                //    }
+
+                //}
 
             }
         }
@@ -102,22 +102,22 @@ namespace PDF_Master.ViewModels.FillAndSign.PropertyPanel
             set
             {
                 SetProperty(ref fillOpacity, value);
-                if (!fillAndSignContentViewModel.isFirst)
-                {
-                    fillAndSignContentViewModel.FillOpacity = value;
+                //if (!fillAndSignContentViewModel.isFirst)
+                //{
+                //    fillAndSignContentViewModel.FillOpacity = value;
 
-                    //if (FillAndSignContentViewModel.IsEdit)
-                    {
-                        PropertyPanel.UpdateAnnotAAttrib(AnnotAttrib.Transparency, fillOpacity);
-                    }
+                //    //if (FillAndSignContentViewModel.IsEdit)
+                //    {
+                //        PropertyPanel.UpdateAnnotAAttrib(AnnotAttrib.Transparency, fillOpacity);
+                //    }
 
-                    //else
-                    {
-                        if (IsFillAndSign) { fillAndSignContentViewModel.SetStamp(); }
+                //    //else
+                //    {
+                //        if (IsFillAndSign) { fillAndSignContentViewModel.SetStamp(); }
 
-                    }
+                //    }
 
-                }
+                //}
 
             }
         }
@@ -127,7 +127,7 @@ namespace PDF_Master.ViewModels.FillAndSign.PropertyPanel
         {
             get { return _isMultiSelected; }
             set { SetProperty(ref _isMultiSelected, value);
-            if(value) { ShapeType= "General Properties"; }
+                if (value) { ShapeType = "General Properties"; }
             }
         }
 
@@ -145,29 +145,8 @@ namespace PDF_Master.ViewModels.FillAndSign.PropertyPanel
             set
             {
                 SetProperty(ref lineWidth, value);
-                if (!fillAndSignContentViewModel.isFirst)
-                {
-                    fillAndSignContentViewModel.LineWidth = value;
-
-                    //if (FillAndSignContentViewModel.IsEdit)
-                    {
-
-                        //PropertyPanel.UpdateAnnotAAttrib(AnnotAttrib.Height, 60);
-                        //PropertyPanel.UpdateAnnotAAttrib(AnnotAttrib.Width, 60);
-                        //if (Shape == "DotShape") { lineWidthMultiple = 5; }
-
-                        PropertyPanel.UpdateAnnotAAttrib(AnnotAttrib.Thickness, LineWidth * lineWidthMultiple);
-                        //fillAndSignContentViewModel.LineWidthMultiple = lineWidthMultiple;
-                        //PropertyPanel.UpdateAnnotAAttrib(AnnotAttrib.Path, updatapath);
-
-                    }
-                    // else
-                    {
-                        if (IsFillAndSign) { fillAndSignContentViewModel.SetStamp(); }
-
-                    }
-
-                }
+                UPDataLineWidth();
+         
             }
         }
         public DelegateCommand<object> SelectedThickCommand { get; set; }
@@ -239,7 +218,7 @@ namespace PDF_Master.ViewModels.FillAndSign.PropertyPanel
                     //if (FillAndSignContentViewModel.IsEdit)
                     {
                         PropertyPanel.UpdateAnnotAAttrib(AnnotAttrib.Thickness, LineWidth * fillAndSignContentViewModel.LineWidthMultiple);
-                        updatapath = new List<List<Point>> { new List<Point> { new Point(0.599976, 7.0286), new Point(5.57775, 11.8), new Point(13.4, 1.40002) } };
+                        updatapath = fillAndSignContentViewModel.keyShape[tag];
 
                         PropertyPanel.UpdateAnnotAAttrib(AnnotAttrib.Path, updatapath);
                         if (PropertyPanel.annotlists != null && PropertyPanel.annotlists.Count >= 1)
@@ -270,7 +249,7 @@ namespace PDF_Master.ViewModels.FillAndSign.PropertyPanel
                     // if (FillAndSignContentViewModel.IsEdit)
                     {
                         PropertyPanel.UpdateAnnotAAttrib(AnnotAttrib.Thickness, LineWidth * fillAndSignContentViewModel.LineWidthMultiple);
-                        updatapath = new List<List<Point>> { new List<Point> { new Point(3.19995, 3.20001), new Point(12.8, 12.8) }, new List<Point> { new Point(12.8, 3.20001), new Point(3.20005, 12.8) } };
+                        updatapath = fillAndSignContentViewModel.keyShape[tag];
                         PropertyPanel.UpdateAnnotAAttrib(AnnotAttrib.Path, updatapath);
                         if (PropertyPanel.annotlists != null && PropertyPanel.annotlists.Count >= 1)
                         {
@@ -301,7 +280,7 @@ namespace PDF_Master.ViewModels.FillAndSign.PropertyPanel
                         //if (FillAndSignContentViewModel.IsEdit)
                         {
                             PropertyPanel.UpdateAnnotAAttrib(AnnotAttrib.Thickness, LineWidth * fillAndSignContentViewModel.LineWidthMultiple);
-                            updatapath = new List<List<Point>> { new List<Point> { new Point(5, 5), new Point(28, 5) }, new List<Point> { new Point(28, 5), new Point(28, 27) }, new List<Point> { new Point(28, 27), new Point(5, 27) }, new List<Point> { new Point(5, 27), new Point(5, 5) } };
+                            updatapath = fillAndSignContentViewModel.keyShape[tag];
                             PropertyPanel.UpdateAnnotAAttrib(AnnotAttrib.Path, updatapath);
                             if (PropertyPanel.annotlists != null && PropertyPanel.annotlists.Count >= 1)
                             {
@@ -332,7 +311,7 @@ namespace PDF_Master.ViewModels.FillAndSign.PropertyPanel
                         // if (FillAndSignContentViewModel.IsEdit)
                         {
                             PropertyPanel.UpdateAnnotAAttrib(AnnotAttrib.Thickness, LineWidth * fillAndSignContentViewModel.LineWidthMultiple);
-                            updatapath = new List<List<Point>> { new List<Point> { new Point(3.19995, 3.20001), new Point(28, 3.20001) } };
+                            updatapath = fillAndSignContentViewModel.keyShape[tag];
                             PropertyPanel.UpdateAnnotAAttrib(AnnotAttrib.Path, updatapath);
                             if (PropertyPanel.annotlists != null && PropertyPanel.annotlists.Count >= 1)
                             {
@@ -367,7 +346,7 @@ namespace PDF_Master.ViewModels.FillAndSign.PropertyPanel
                         // if (FillAndSignContentViewModel.IsEdit)
                         {
                             lineWidthMultiple = 5;
-                            updatapath = new List<List<Point>> { new List<Point> { new Point(3.19995, 3.19995), new Point(3.19995, 3.19995) } };
+                            updatapath = fillAndSignContentViewModel.keyShape[tag];
                             PropertyPanel.UpdateAnnotAAttrib(AnnotAttrib.Thickness, LineWidth * 5);
                             PropertyPanel.UpdateAnnotAAttrib(AnnotAttrib.Path, updatapath);
                             if (PropertyPanel.annotlists != null && PropertyPanel.annotlists.Count >= 1)
@@ -403,22 +382,17 @@ namespace PDF_Master.ViewModels.FillAndSign.PropertyPanel
             {
                 case "DotShape":
                     return "Dot";
-                    break;
+
                 case "LineShape":
                     return "Line";
-                    break;
                 case "RectShape":
                     return "Rectangle";
-                    break;
                 case "ForkShape":
                     return "Fork";
-                    break;
                 case "HookShape":
                     return "Hook";
-                    break;
-                    default:
+                default:
                     return "General Properties";
-                    break;
             }
 
 
@@ -497,12 +471,72 @@ namespace PDF_Master.ViewModels.FillAndSign.PropertyPanel
                 if (content != null)
                 {
                     var intData = int.Parse(content);
-                    LineWidth = intData;
+                    LineWidth = intData;
+                    UPDataLineWidth();
                 }
             }
         }
+        private void UPDataLineWidth(){
+
+            if (!fillAndSignContentViewModel.isFirst)
+            {
+                fillAndSignContentViewModel.LineWidth = LineWidth;
+
+                //if (FillAndSignContentViewModel.IsEdit)
+                {
+
+                    PropertyPanel.UpdateAnnotAAttrib(AnnotAttrib.Thickness, LineWidth * lineWidthMultiple);
+
+                }
+                // else
+                {
+                    if (IsFillAndSign) { fillAndSignContentViewModel.SetStamp(); }
+
+                }
+
+            }
+        }
 
-        private void SelectedColor_Command(object obj)
+        private void UPDataColor()
+        {
+
+            if (!fillAndSignContentViewModel.isFirst)
+            {
+                fillAndSignContentViewModel.SelectColor = SelectColor;
+                //if (FillAndSignContentViewModel.IsEdit)
+                {
+                    // PropertyPanel.UpdateAnnotAAttrib(AnnotAttrib.Thickness, LineWidth * lineWidthMultiple);
+                    PropertyPanel.UpdateAnnotAAttrib(AnnotAttrib.Color, (selectColor as SolidColorBrush).Color);
+                }
+                //else
+                {
+                    if (IsFillAndSign) { fillAndSignContentViewModel.SetStamp(); }
+
+                }
+
+            }
+        }
+        private void UPDataOpacity()
+        {
+            if (!fillAndSignContentViewModel.isFirst)
+            {
+                fillAndSignContentViewModel.FillOpacity = FillOpacity;
+
+                //if (FillAndSignContentViewModel.IsEdit)
+                {
+                    PropertyPanel.UpdateAnnotAAttrib(AnnotAttrib.Transparency, fillOpacity);
+                }
+
+                //else
+                {
+                    if (IsFillAndSign) { fillAndSignContentViewModel.SetStamp(); }
+
+                }
+
+            }
+        }
+
+            private void SelectedColor_Command(object obj)
         {
             if (obj != null)
             {
@@ -510,7 +544,8 @@ namespace PDF_Master.ViewModels.FillAndSign.PropertyPanel
                 if (colorValue != null)
                 {
 
-                    SelectColor = new SolidColorBrush(colorValue);
+                    SelectColor = new SolidColorBrush(colorValue);
+                    UPDataColor();
                     SelectColor.Opacity = FillOpacity;
 
                     Dictionary<AnnotArgsType, object> changeData = new Dictionary<AnnotArgsType, object>();
@@ -520,15 +555,15 @@ namespace PDF_Master.ViewModels.FillAndSign.PropertyPanel
 
             }
 
-        }
-
-        private void SelectedOpacityValue(object obj)
+        }
+        
+            private void SelectedOpacityValue(object obj)
         {
             if (obj != null)
             {
                 FillOpacity = (double)obj;
                 SelectColor.Opacity = FillOpacity;
-
+                UPDataOpacity();
                 //AnnotEvent?.UpdateAttrib(AnnotAttrib.Transparency, FillOpacity);
                 //AnnotEvent?.UpdateAnnot();
                 Dictionary<AnnotArgsType, object> changeData = new Dictionary<AnnotArgsType, object>();
@@ -627,6 +662,7 @@ namespace PDF_Master.ViewModels.FillAndSign.PropertyPanel
                 {
                     //SelectColor = new SolidColorBrush(annot.InkColor);
                     //FillOpacity = annot.Transparency;
+                    //LineWidth = annot.LineWidth;
                     foreach (var point in fillAndSignContentViewModel.viewContentViewModel.FillAndSign)
                     {
                         if (annot.PageIndex == point.PageIndex && annot.AnnotIndex == point.AnnotIndex)

+ 1 - 0
PDF Office/ViewModels/Tools/AnnotToolContentViewModel.Function.cs

@@ -801,6 +801,7 @@ namespace PDF_Master.ViewModels.Tools
             if (viewContentViewModel.FillAndSign != null && viewContentViewModel.FillAndSign.Count > 0 && annots != null && annots.Count > 0)
             {
                 var annotFillAndSign = viewContentViewModel.FillAndSign.FirstOrDefault(temp => temp.PageIndex == annots[0].PageIndex && temp.AnnotIndex == annots[0].AnnotIndex);
+
                 if (annotFillAndSign != null)
                 {
                     this.events.GetEvent<FillAndSignEvent>().Publish(new FillAndSigntEventArgs { Action = tag, AppUnicode = App.mainWindowViewModel.SelectedItem.Unicode, Annots = annots });