Browse Source

Merge branch 'dev' of http://git.kdan.cc:8865/Windows/PDFOffice_Windows_exe into dev

ZhouJieSheng 2 years ago
parent
commit
77c739f61c
27 changed files with 734 additions and 321 deletions
  1. BIN
      PDF Office/ComPDFKit.Viewer.dll
  2. 2 2
      PDF Office/Model/Dialog/HomePageToolsDialogs/HomePagePictureToPDFDialogModel.cs
  3. 48 32
      PDF Office/Styles/OutLineItemStyle.xaml
  4. 2 3
      PDF Office/Styles/TabControlStyle.xaml
  5. 14 6
      PDF Office/Styles/ToggleButton.xaml
  6. 27 18
      PDF Office/ViewModels/BOTA/AnnotationContentViewModel.cs
  7. 53 11
      PDF Office/ViewModels/Dialog/HomePageToolsDialogs/HomePagePictureToPDFDialogViewModel.cs
  8. 84 16
      PDF Office/ViewModels/PropertyPanel/AnnotPanel/FreehandAnnotPropertyViewModel.cs
  9. 39 4
      PDF Office/ViewModels/PropertyPanel/AnnotPanel/FreetextAnnotPropertyViewModel.cs
  10. 1 0
      PDF Office/ViewModels/PropertyPanel/AnnotPanel/LinkAnnotPropertyViewModel.cs
  11. 25 2
      PDF Office/ViewModels/PropertyPanel/AnnotPanel/SharpsAnnotPropertyViewModel.cs
  12. 13 6
      PDF Office/ViewModels/PropertyPanel/AnnotPanel/SnapshotEditMenuViewModel.cs
  13. 28 1
      PDF Office/ViewModels/PropertyPanel/AnnotPanel/StickyNotePropertyViewModel.cs
  14. 60 17
      PDF Office/ViewModels/PropertyPanel/AnnotPanel/TextAnnotPropertyViewModel.cs
  15. 121 74
      PDF Office/ViewModels/Tools/AnnotToolContentViewModel.Command.cs
  16. 137 96
      PDF Office/ViewModels/Tools/AnnotToolContentViewModel.Function.cs
  17. 1 0
      PDF Office/ViewModels/Tools/AnnotToolContentViewModel.Properties.cs
  18. 3 1
      PDF Office/ViewModels/ViewContentViewModel.cs
  19. 2 2
      PDF Office/Views/BOTA/AnnotationListItem.xaml
  20. 13 4
      PDF Office/Views/BOTA/AnnotationListItem.xaml.cs
  21. 1 1
      PDF Office/Views/Dialog/HomePageToolsDialogs/HomePagePictureToPDFDialog.xaml
  22. 5 0
      PDF Office/Views/Dialog/HomePageToolsDialogs/HomePagePictureToPDFDialog.xaml.cs
  23. 14 9
      PDF Office/Views/PropertyPanel/AnnotPanel/FreehandAnnotProperty.xaml
  24. 8 3
      PDF Office/Views/PropertyPanel/AnnotPanel/FreetextAnnotProperty.xaml
  25. 15 5
      PDF Office/Views/PropertyPanel/AnnotPanel/SharpsAnnotProperty.xaml
  26. 10 4
      PDF Office/Views/PropertyPanel/AnnotPanel/StickyNoteProperty.xaml
  27. 8 4
      PDF Office/Views/PropertyPanel/AnnotPanel/TextAnnotProperty.xaml

BIN
PDF Office/ComPDFKit.Viewer.dll


+ 2 - 2
PDF Office/Model/Dialog/HomePageToolsDialogs/HomePagePictureToPDFDialogModel.cs

@@ -18,12 +18,12 @@ namespace PDF_Office.Model.Dialog.HomePageToolsDialogs
         /// <summary>
         /// 文件名标签
         /// </summary>
-        public string RearFileNameLabel = "down";
+        public string RearFileNameLabel = "";
 
         /// <summary>
         /// 文件名标签
         /// </summary>
-        public string FrontFileNameLabel = "part";
+        public string FrontFileNameLabel = "";
 
         /// <summary>
         /// 当前文件路径

File diff suppressed because it is too large
+ 48 - 32
PDF Office/Styles/OutLineItemStyle.xaml


+ 2 - 3
PDF Office/Styles/TabControlStyle.xaml

@@ -508,7 +508,6 @@
                                 x:Name="PART_SelectedContentHost"
                                 Margin="{TemplateBinding Padding}"
                                 ContentSource="SelectedContent"
-
                                 SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
                         </Border>
                     </Grid>
@@ -599,9 +598,9 @@
                             <ContentPresenter
                                 x:Name="PART_SelectedContentHost"
                                 Margin="{TemplateBinding Margin}"
-                                ContentSource="SelectedContent"
                                 HorizontalAlignment="Right"
                                 VerticalAlignment="Center"
+                                ContentSource="SelectedContent"
                                 SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
                         </Border>
                     </Grid>
@@ -646,8 +645,8 @@
                     <Grid>
                         <Border
                             Name="Border"
-                            Padding="8,0"
                             Height="32"
+                            Padding="8,0"
                             Background="Transparent"
                             BorderBrush="Transparent"
                             BorderThickness="1"

+ 14 - 6
PDF Office/Styles/ToggleButton.xaml

@@ -61,7 +61,11 @@
                         BorderThickness="{TemplateBinding Border.BorderThickness}"
                         CornerRadius="{StaticResource border-radius.4}"
                         SnapsToDevicePixels="True">
-                        <Grid x:Name="grid" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" VerticalAlignment="Center" HorizontalAlignment="Center">
+                        <Grid
+                            x:Name="grid"
+                            HorizontalAlignment="Center"
+                            VerticalAlignment="Center"
+                            SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}">
                             <StackPanel x:Name="state1" Visibility="Collapsed">
                                 <Rectangle
                                     Width="14"
@@ -154,10 +158,10 @@
                         SnapsToDevicePixels="True">
                         <Grid
                             x:Name="grid"
-                            SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" VerticalAlignment="Center" HorizontalAlignment="Center">
-                            <StackPanel
-                                x:Name="state1"
-                                Visibility="Collapsed">
+                            HorizontalAlignment="Center"
+                            VerticalAlignment="Center"
+                            SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}">
+                            <StackPanel x:Name="state1" Visibility="Collapsed">
                                 <Rectangle
                                     Width="14"
                                     Height="1.5"
@@ -348,7 +352,11 @@
                         BorderThickness="{TemplateBinding Border.BorderThickness}"
                         CornerRadius="{StaticResource border-radius.4}"
                         SnapsToDevicePixels="True">
-                        <Grid x:Name="grid" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" VerticalAlignment="Center" HorizontalAlignment="Center">
+                        <Grid
+                            x:Name="grid"
+                            HorizontalAlignment="Center"
+                            VerticalAlignment="Center"
+                            SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}">
                             <StackPanel x:Name="state1" Visibility="Collapsed">
                                 <Rectangle
                                     Width="14"

+ 27 - 18
PDF Office/ViewModels/BOTA/AnnotationContentViewModel.cs

@@ -143,26 +143,34 @@ namespace PDF_Office.ViewModels.BOTA
             dlg.DefaultExt = ".xfdf";
             if (dlg.ShowDialog() == true)
             {
-                string fileName = dlg.FileName;
-                await Task.Delay(5);
-                var result = PdfViewer.ImportAnnotationFromXFDFPath(fileName);
-                if (result == false)
+                try
                 {
-                    //MessageBoxEx.Show("导入失败", "", Winform.MessageBoxButtons.OK, Winform.MessageBoxIcon.Error);
-                    AlertsMessage alertsMessage = new AlertsMessage();
-                    alertsMessage.Show("提示", "导入失败!", "OK");
-                    return;
-                }
-                PdfViewer.ReloadVisibleAnnots();
-                //提取出来的注释文件 时间为空  则显示未系统当前时间
-                CurrentAnnotationArgs = GetDocumentAnnotionList();
+                    string fileName = dlg.FileName;
+                    await Task.Delay(10);
+                    var result = PdfViewer.ImportAnnotationFromXFDFPath(fileName);
+                    if (result == false)
+                    {
+                        //MessageBoxEx.Show("导入失败", "", Winform.MessageBoxButtons.OK, Winform.MessageBoxIcon.Error);
+                        AlertsMessage alertsMessage = new AlertsMessage();
+                        alertsMessage.Show("提示", "导入失败!", "OK");
+                        return;
+                    }
+                    PdfViewer.ReloadVisibleAnnots();
+                    //提取出来的注释文件 时间为空  则显示未系统当前时间
+                    CurrentAnnotationArgs = GetDocumentAnnotionList();
 
-                AnnotationListItems.Clear();
-                AnnotationListItems.AddRange(CurrentAnnotationArgs);
-                await Task.Delay(5);
-                RefreshAnnotationListItems(null);
+                    AnnotationListItems.Clear();
+                    AnnotationListItems.AddRange(CurrentAnnotationArgs);
+                    await Task.Delay(5);
+                    RefreshAnnotationListItems(null);
 
-                PdfViewer.UndoManager.CanSave = true;
+                    PdfViewer.UndoManager.CanSave = true;
+                }
+                catch (Exception ex)
+                {
+                    AlertsMessage alertsMessage = new AlertsMessage();
+                    alertsMessage.Show("提示", "导入失败!" + ex.Message, "OK");
+                }
             }
         }
 
@@ -863,7 +871,8 @@ namespace PDF_Office.ViewModels.BOTA
                     {
                         if (AnnotationListItems[k].PageIndex == pageIndex && AnnotationListItems[k].AnnotIndex == annotIndex && items[j].AnnotIndex == annotIndex)
                         {
-                            //AnnotationHandlerEventArgs args = GetAddAnnotEventArgs(items[j]);
+                            AnnotationHandlerEventArgs args = GetAddAnnotEventArgs(items[j]);
+
                             AnnotationListItems[k] = GetAddAnnotEventArgs(items[j]);
 
                             for (int i = 0; i < CurrentAnnotationArgs.Count; i++)

+ 53 - 11
PDF Office/ViewModels/Dialog/HomePageToolsDialogs/HomePagePictureToPDFDialogViewModel.cs

@@ -89,13 +89,24 @@ namespace PDF_Office.ViewModels.Dialog.HomePageToolsDialogs
             }
         }
 
-        private string selectFileName = "False";
+        private string imageToPDFBtnIsEnable = "True";
+        public string ImageToPDFBtnIsEnable
+        {
+            get { return imageToPDFBtnIsEnable; }
+            set
+            {
+                SetProperty(ref imageToPDFBtnIsEnable, value);
+            }
+        }
+
+        private string selectFileName = "File";
         public string SelectFileName
         {
             get { return selectFileName; }
             set
             {
                 SetProperty(ref selectFileName, value);
+
             }
         }
 
@@ -145,7 +156,17 @@ namespace PDF_Office.ViewModels.Dialog.HomePageToolsDialogs
             PictureToPDFGridIsEnabled = "False";
             if (pictureToPDFModel.Mode == HomePagePictureToPDFDialogModel.ToPDFFileMode.NewFiles)
             {
+                FolderBrowserDialog dlg = new FolderBrowserDialog();
+                string saveSelectedPath = "";
+                string SaveSelectedPath = "";
+                if (dlg.ShowDialog() == System.Windows.Forms.DialogResult.OK)
+                {
+                    SaveSelectedPath = dlg.SelectedPath.Trim();
+                    saveSelectedPath = saveSelectedPath + "\\";
+                }
+                else { PictureToPDFGridIsEnabled = "True"; return;  }
                 fileNamesIndex = 0;
+                string fileName = "";
                 foreach (var filename in fileNames)
                 {
                     ImagesDataTable.Rows[fileNamesIndex]["FileState"] = "wait";
@@ -161,22 +182,33 @@ namespace PDF_Office.ViewModels.Dialog.HomePageToolsDialogs
                     FileInfo fileinfo = new FileInfo(filename);
                     JpegInsertPage(ref topdfdoc, filename, fileinfo,img.Width,img.Height);
                     Trace.WriteLine("Path.GetTempPath():" + Path.GetTempPath());
-                    string fileName = savefilename(filename);
+                    fileName = savefilename(filename,saveSelectedPath);
                     topdfdoc.WriteToFilePath(fileName);
                     topdfdoc.Release();
                     string file_size = (((float)fileinfo.Length) / 1024).ToString() + " K";
                     ImagesDataTable.Rows[fileNamesIndex]["FileState"] = "complete";
                     ImagesCurrentDataTable.Rows[fileNamesIndex]["FileState"] = "complete";
                     fileNamesIndex++;
-                    System.Diagnostics.Process.Start("Explorer", "/select," + fileName);
+                    //System.Diagnostics.Process.Start("Explorer", "/select," + fileName);
                 }
-                
+                System.Diagnostics.Process.Start("Explorer", "/select," + fileName);
             }
             if (pictureToPDFModel.Mode == HomePagePictureToPDFDialogModel.ToPDFFileMode.OneNewFile)
             {
+                
                 CPDFDocument topdfdoc = CPDFDocument.CreateDocument();
                 int pageindex = 0;
-                foreach (var filename in fileNames) {
+                FolderBrowserDialog folderDialog = new FolderBrowserDialog();
+                System.Windows.Forms.SaveFileDialog sfd = new System.Windows.Forms.SaveFileDialog();
+                sfd.FileName = "Untitle";
+                sfd.Filter = "PDF|*.pdf;";
+                string NewFileName = "";
+                if (sfd.ShowDialog() == System.Windows.Forms.DialogResult.OK)
+                {
+                    NewFileName=sfd.FileName;
+                }
+                else { PictureToPDFGridIsEnabled = "True"; return; }
+                    foreach (var filename in fileNames) {
                     ImagesDataTable.Rows[fileNamesIndex]["FileState"] = "wait";
                     ImagesCurrentDataTable.Rows[fileNamesIndex]["FileState"] = "wait";
                     Image img = Image.FromFile(filename);
@@ -194,12 +226,20 @@ namespace PDF_Office.ViewModels.Dialog.HomePageToolsDialogs
                     ImagesCurrentDataTable.Rows[fileNamesIndex]["FileState"] = "complete";
                     fileNamesIndex++;
                 }
-                System.Diagnostics.Process.Start("Explorer", "/select," + savefilename(fileNames[0]));
-                topdfdoc.WriteToFilePath(savefilename(fileNames[0]));
+                System.Diagnostics.Process.Start("Explorer", "/select," + NewFileName);
+                topdfdoc.WriteToFilePath(CommonHelper.CreateFilePath(NewFileName));
                 topdfdoc.Release();
             }
             if (pictureToPDFModel.Mode == HomePagePictureToPDFDialogModel.ToPDFFileMode.SelectFileName)
             {
+                FolderBrowserDialog dlg = new FolderBrowserDialog();
+                string saveSelectedPath = "";
+                if (dlg.ShowDialog() == System.Windows.Forms.DialogResult.OK)
+                {
+                    saveSelectedPath = dlg.SelectedPath.Trim();
+                    saveSelectedPath = saveSelectedPath + "\\";
+                }
+                else {PictureToPDFGridIsEnabled = "True"; return; }
                 CPDFDocument topdfdoc = CPDFDocument.InitWithFilePath(pictureToPDFModel.FilePath);
                 if (topdfdoc == null)
                 {
@@ -255,8 +295,9 @@ namespace PDF_Office.ViewModels.Dialog.HomePageToolsDialogs
                     ImagesCurrentDataTable.Rows[fileNamesIndex]["FileState"] = "complete";
                     fileNamesIndex++;
                 }
-                topdfdoc.WriteToLoadedPath();
-                System.Diagnostics.Process.Start("Explorer", "/select," + topdfdoc.FilePath);
+                string saveselectedpath = CommonHelper.CreateFilePath(saveSelectedPath + topdfdoc.FileName+".pdf");
+                topdfdoc.WriteToFilePath(saveselectedpath);
+                System.Diagnostics.Process.Start("Explorer", "/select," + saveselectedpath);
                 topdfdoc.Release();
             }
             PictureToPDFGridIsEnabled = "True";
@@ -266,10 +307,10 @@ namespace PDF_Office.ViewModels.Dialog.HomePageToolsDialogs
         /// <summary>
         /// 设置保存后的文件名
         /// </summary>
-        public string savefilename(string filename)
+        public string savefilename(string filename,string filepath)
         {
             FileInfo file = new FileInfo(filename);
-            return CommonHelper.CreateFilePath(filename.Replace(file.Name, "") + pictureToPDFModel.FrontFileNameLabel + file.Name + pictureToPDFModel.RearFileNameLabel + ".pdf");
+            return CommonHelper.CreateFilePath(filepath + pictureToPDFModel.FrontFileNameLabel + file.Name.Replace(file.Extension,".pdf") + pictureToPDFModel.RearFileNameLabel);
         }
         #endregion
 
@@ -286,6 +327,7 @@ namespace PDF_Office.ViewModels.Dialog.HomePageToolsDialogs
             {
                 SelectFileName=dlg.FileName;
                 pictureToPDFModel.FilePath = dlg.FileName;
+                ImageToPDFBtnIsEnable = "True";
             }
         }
 

+ 84 - 16
PDF Office/ViewModels/PropertyPanel/AnnotPanel/FreehandAnnotPropertyViewModel.cs

@@ -68,7 +68,7 @@ namespace PDF_Office.ViewModels.PropertyPanel.AnnotPanel
             }
         }
 
-
+        bool isCanSave = false;
         private double thicknessLine = 1;
         public double ThicknessLine
         {
@@ -76,8 +76,12 @@ namespace PDF_Office.ViewModels.PropertyPanel.AnnotPanel
             set
             {
                 SetProperty(ref thicknessLine, value);
-                AnnotEvent?.UpdateAttrib(AnnotAttrib.Thickness, thicknessLine);
-                AnnotEvent?.UpdateAnnot();
+                if(isCanSave)
+                {
+                    AnnotEvent?.UpdateAttrib(AnnotAttrib.Thickness, thicknessLine);
+                    AnnotEvent?.UpdateAnnot();
+                }
+
             }
         }
 
@@ -93,7 +97,12 @@ namespace PDF_Office.ViewModels.PropertyPanel.AnnotPanel
             }
         }
 
-      
+        private bool _isMultiSelected = false;
+        public bool IsMultiSelected
+        {
+            get { return _isMultiSelected; }
+            set => SetProperty(ref _isMultiSelected, value);
+        }
 
         public AnnotAttribEvent AnnotEvent { get; set; }
         private AnnotHandlerEventArgs Annot;
@@ -150,17 +159,24 @@ namespace PDF_Office.ViewModels.PropertyPanel.AnnotPanel
             if (obj != null)
             {
                 var tag = ((string)obj);
+                DashStyle newDash = new DashStyle();
                 switch (tag)
                 {
                     case "Dashed":
+                      
+                        newDash.Dashes.Add(2);
+                        newDash.Dashes.Add(2);
                         AnnotEvent?.UpdateAttrib(AnnotAttrib.LineStyle, DashStyles.Dash);
+                        AnnotEvent?.UpdateAttrib(AnnotAttrib.LineStyle, newDash);
+                        
                         break;
 
                     case "Solid":
-                        AnnotEvent?.UpdateAttrib(AnnotAttrib.LineStyle, DashStyles.Solid);
+                        AnnotEvent?.UpdateAttrib(AnnotAttrib.LineStyle, newDash);
                         break;
 
                 }
+               
                 AnnotEvent?.UpdateAnnot();
             }
         }
@@ -175,8 +191,20 @@ namespace PDF_Office.ViewModels.PropertyPanel.AnnotPanel
                 if (content != null)
                 {
                     var intData = double.Parse(content);
-                    AnnotEvent?.UpdateAttrib(AnnotAttrib.Thickness, intData);
-                    AnnotEvent?.UpdateAnnot();
+                    if (IsMultiSelected)
+                    {
+                        foreach (var itemEvent in PropertyPanel.AnnotEvents)
+                        {
+                            itemEvent?.UpdateAttrib(AnnotAttrib.Thickness, intData);
+                            itemEvent?.UpdateAnnot();
+                        }
+                    }
+                    else
+                    {
+                        AnnotEvent?.UpdateAttrib(AnnotAttrib.Thickness, intData);
+                        AnnotEvent?.UpdateAnnot();
+                    }
+                   
                     ThicknessLine = intData;
                 }
             }
@@ -206,13 +234,24 @@ namespace PDF_Office.ViewModels.PropertyPanel.AnnotPanel
                 var colorValue = (Color)obj;
                 if (colorValue != null)
                 {
-
-                    SelectColor = new SolidColorBrush(colorValue);
-                    SelectColor.Opacity = AnnotOpacity;
-
-                    Dictionary<AnnotArgsType, object> changeData = new Dictionary<AnnotArgsType, object>();
-                    changeData[AnnotArgsType.AnnotFreehand] = obj;
-                    PropertyPanel.DataChangedInvoke(this, changeData);
+                    if (IsMultiSelected)
+                    {
+                        foreach (var item in PropertyPanel.AnnotEvents)
+                        {
+                            item?.UpdateAttrib(AnnotAttrib.Color, colorValue);
+                            item?.UpdateAnnot();
+                        }
+                    }
+                    else
+                    {
+                        SelectColor = new SolidColorBrush(colorValue);
+                        SelectColor.Opacity = AnnotOpacity;
+
+                        Dictionary<AnnotArgsType, object> changeData = new Dictionary<AnnotArgsType, object>();
+                        changeData[AnnotArgsType.AnnotFreehand] = obj;
+                        PropertyPanel.DataChangedInvoke(this, changeData);
+                    }
+                   
                 }
             }
         }
@@ -249,6 +288,8 @@ namespace PDF_Office.ViewModels.PropertyPanel.AnnotPanel
 
         public void OnNavigatedFrom(NavigationContext navigationContext)
         {
+            IsMultiSelected = false;
+            isCanSave = false;
         }
 
 
@@ -260,9 +301,36 @@ namespace PDF_Office.ViewModels.PropertyPanel.AnnotPanel
             {
                 AnnotEvent = PropertyPanel.AnnotEvent;
                 Annot = PropertyPanel.annot;
-                GetAnnotProperty();
-                LoadPropertyHandler?.Invoke(null, (Annot as FreehandAnnotArgs).InkColor);
+                if (PropertyPanel.annotlists != null && PropertyPanel.annotlists.Count > 1)
+                {
+                    IsMultiSelected = true;
+                }
+                else
+                {
+                    IsMultiSelected = false;
+                }
+
+                if (IsMultiSelected)
+                {
+                    double thickness = 0;
+                    foreach(var item in PropertyPanel.annotlists)
+                    {
+                        if ((item as FreehandAnnotArgs).LineWidth >= thickness)
+                            thickness = (item as FreehandAnnotArgs).LineWidth;
+                    }
+                    
+                    ThicknessLine = thickness;
+                }
+                else
+                {
+                    GetAnnotProperty();
+                    if (Annot is FreehandAnnotArgs)
+                        LoadPropertyHandler?.Invoke(null, (Annot as FreehandAnnotArgs).InkColor);
+                }
+                   
             }
+
+            isCanSave = true;
         }
 
         private void GetAnnotProperty()

+ 39 - 4
PDF Office/ViewModels/PropertyPanel/AnnotPanel/FreetextAnnotPropertyViewModel.cs

@@ -68,6 +68,13 @@ namespace PDF_Office.ViewModels.PropertyPanel.AnnotPanel
             }
         }
 
+        private bool _isMultiSelected = false;
+        public bool IsMultiSelected
+        {
+            get { return _isMultiSelected; }
+            set => SetProperty(ref _isMultiSelected, value);
+        }
+
         public DelegateCommand<object> SelectedFillOpacityCommand { get; set; }
         public DelegateCommand<object> SelectedFontStyleCommand { get; set; }
         public DelegateCommand<object> SelectedColorCommand { get; set; }
@@ -349,6 +356,7 @@ namespace PDF_Office.ViewModels.PropertyPanel.AnnotPanel
         {
             IsCanSave = false;
             ChangedValue -= FontMode_ChangedValue;
+            IsMultiSelected = false;
         }
 
         public AnnotAttribEvent AnnotEvent { get; set; }
@@ -364,12 +372,38 @@ namespace PDF_Office.ViewModels.PropertyPanel.AnnotPanel
                 LoadPropertyHandler?.Invoke(this, Annot);
                 ChangedValue -= FontMode_ChangedValue;
                 ChangedValue += FontMode_ChangedValue;
-                SelectColor = new SolidColorBrush(Annot.FontColor);
-                FillColor = new SolidColorBrush(Annot.BgColor);
+                if (PropertyPanel.annotlists != null && PropertyPanel.annotlists.Count > 1)
+                {
+                    IsMultiSelected = true;
+                }
+                else
+                {
+                    IsMultiSelected = false;
+                }
+
+                if(IsMultiSelected)
+                {
+
+                }
+                else
+                {
+                    GetAnnotProperty();
+                }
+
                 IsCanSave = true;
             }
         }
 
+        private void GetAnnotProperty()
+        {
+            SelectColor = new SolidColorBrush(Annot.FontColor);
+            FillColor = new SolidColorBrush(Annot.BgColor);
+
+            GetCurrentFontSize((int)Annot.FontSize);
+            GetCurrentFontFamily(Annot.FontFamily.ToString(), Annot.FontFamily.ToString());
+            GetFontWeights_Style(Annot.FontStyle, Annot.FontWeight);
+        }
+
         private void FontMode_ChangedValue(object sender, FontSetModeType e)
         {
             if (sender != null)
@@ -382,13 +416,14 @@ namespace PDF_Office.ViewModels.PropertyPanel.AnnotPanel
                             var item = PresetFontList.FirstOrDefault(temp => temp.mTag == (string)sender);
                             if (item != null && Annot != null)
                             {
+
                             }
                         }
                         break;
                     case FontSetModeType.FontFamilys:
-                        if (sender is string == true)
+                        if (sender is string == true && IsCanSave)
                         {
-                            AnnotEvent.UpdateAttrib(AnnotAttrib.FontFamily, (string)sender);
+                            AnnotEvent.UpdateAttrib(AnnotAttrib.FontFamily, new FontFamily((string)sender));
                             AnnotEvent.UpdateAnnot();
                         }
 

+ 1 - 0
PDF Office/ViewModels/PropertyPanel/AnnotPanel/LinkAnnotPropertyViewModel.cs

@@ -696,6 +696,7 @@ namespace PDF_Office.ViewModels.PropertyPanel.AnnotPanel
             {
                 region.RequestNavigate(viewContentViewModel.TipContentRegionName, "LinkAnnotTip");
             }
+            if(string.IsNullOrEmpty(PageNumTextContent))
             viewContentViewModel.ShowTip(true);
         }
 

+ 25 - 2
PDF Office/ViewModels/PropertyPanel/AnnotPanel/SharpsAnnotPropertyViewModel.cs

@@ -172,7 +172,12 @@ namespace PDF_Office.ViewModels.PropertyPanel.AnnotPanel
             }
         }
 
-        
+        private bool _isMultiSelected = false;
+        public bool IsMultiSelected
+        {
+            get { return _isMultiSelected; }
+            set => SetProperty(ref _isMultiSelected, value);
+        }
 
         #endregion
 
@@ -396,6 +401,7 @@ namespace PDF_Office.ViewModels.PropertyPanel.AnnotPanel
 
         public void OnNavigatedFrom(NavigationContext navigationContext)
         {
+            IsMultiSelected = false;
         }
 
         private void SetAnnotType()
@@ -434,7 +440,24 @@ namespace PDF_Office.ViewModels.PropertyPanel.AnnotPanel
                 AnnotEvent = PropertyPanel.AnnotEvent;
                 AnnotType = PropertyPanel.annot.EventType;
                 Annot = PropertyPanel.annot;
-                GetAnnotProperty();
+                if (PropertyPanel.annotlists != null && PropertyPanel.annotlists.Count > 1)
+                {
+                    IsMultiSelected = true;
+                }
+                else
+                {
+                    IsMultiSelected = false;
+                }
+
+                if(IsMultiSelected)
+                {
+
+                }
+                else
+                {
+                    GetAnnotProperty();
+                }
+                
                 LoadPropertyHandler?.Invoke(null, Annot);
             }
 

+ 13 - 6
PDF Office/ViewModels/PropertyPanel/AnnotPanel/SnapshotEditMenuViewModel.cs

@@ -54,7 +54,7 @@ namespace PDF_Office.ViewModels.PropertyPanel.AnnotPanel
 
         public SnapshotEditMenuViewModel()
         {
-            SnapCopyCommand = new DelegateCommand(SnapCopyEvent);
+            SnapCopyCommand = new DelegateCommand(CopyEvent);
             ExportPNGCommand = new DelegateCommand(ExportPNGEvent);
             ExportJPGCommand = new DelegateCommand(ExportJPGEvent);
             ExportPDFCommand = new DelegateCommand(ExportPDFEvent);
@@ -81,6 +81,7 @@ namespace PDF_Office.ViewModels.PropertyPanel.AnnotPanel
                             printDlg.PrintVisual(visualItem, "Snapshot");
                         }
                     }
+                    PDFViewer.RemoveTool(false);
                     PDFViewer.SetMouseMode(MouseModes.PanTool);
                     if (SnapToolEvent != null)
                     {
@@ -196,11 +197,16 @@ namespace PDF_Office.ViewModels.PropertyPanel.AnnotPanel
                             CommonHelper.ExplorerFile(dlg.FileName);
                         }
                     }
-                    PDFViewer.SetMouseMode(MouseModes.PanTool);
-                    if (SnapToolEvent != null)
+
+                    if (PDFViewer != null && PDFViewer.ToolManager != null)
                     {
-                        KeyValuePair<string, object> param = new KeyValuePair<string, object>("CloseSnap", null);
-                        SnapToolEvent.Invoke(this, param);
+                        PDFViewer.RemoveTool(false);
+                        PDFViewer.SetMouseMode(MouseModes.PanTool);
+                        if (SnapToolEvent != null)
+                        {
+                            KeyValuePair<string, object> param = new KeyValuePair<string, object>("CloseSnap", null);
+                            SnapToolEvent.Invoke(this, param);
+                        }
                     }
                 }
             }
@@ -309,7 +315,7 @@ namespace PDF_Office.ViewModels.PropertyPanel.AnnotPanel
         /// <summary>
         /// 复制
         /// </summary>
-        private void SnapCopyEvent()
+        private void CopyEvent()
         {
             if (SnapToolArgs != null)
             {
@@ -318,6 +324,7 @@ namespace PDF_Office.ViewModels.PropertyPanel.AnnotPanel
                 {
                     Bitmap bitmap = BitmapFromWriteableBitmap(saveBitmap);
                     Clipboard.SetImage(ChangeBitmapToBitmapSource(bitmap));
+                    PDFViewer.RemoveTool(false);
                     PDFViewer.SetMouseMode(MouseModes.PanTool);
                     if (SnapToolEvent != null)
                     {

+ 28 - 1
PDF Office/ViewModels/PropertyPanel/AnnotPanel/StickyNotePropertyViewModel.cs

@@ -37,6 +37,14 @@ namespace PDF_Office.ViewModels.PropertyPanel.AnnotPanel
             get { return _sharpColor; }
             set { SetProperty(ref _sharpColor, value); }
         }
+
+        private bool _isMultiSelected = false;
+        public bool IsMultiSelected
+        {
+            get { return _isMultiSelected; }
+            set => SetProperty(ref _isMultiSelected, value);
+        }
+
         Dictionary<string, string> StickyNoteTypes = new Dictionary<string, string>();
         public event EventHandler<object> LoadPropertyHandler;
         public DelegateCommand<object> SelectedColorChangedCommand { get; set; }
@@ -127,6 +135,7 @@ namespace PDF_Office.ViewModels.PropertyPanel.AnnotPanel
 
         public void OnNavigatedFrom(NavigationContext navigationContext)
         {
+            IsMultiSelected = false;
         }
 
         public AnnotAttribEvent AnnotEvent { get; set; }
@@ -139,7 +148,25 @@ namespace PDF_Office.ViewModels.PropertyPanel.AnnotPanel
             {
                 AnnotEvent = PropertyPanel.AnnotEvent;
                 Annot = PropertyPanel.annot;
-                GetAnnotProperty();
+
+                if (PropertyPanel.annotlists != null && PropertyPanel.annotlists.Count > 1)
+                {
+                    IsMultiSelected = true;
+                }
+                else
+                {
+                    IsMultiSelected = false;
+                }
+
+                if (IsMultiSelected)
+                {
+
+                }
+                else
+                {
+                    GetAnnotProperty();
+                }
+
             }
         }
 

+ 60 - 17
PDF Office/ViewModels/PropertyPanel/AnnotPanel/TextAnnotPropertyViewModel.cs

@@ -1,5 +1,6 @@
 using ComPDFKitViewer;
 using ComPDFKitViewer.AnnotEvent;
+using PDF_Office.Helper;
 using PDF_Office.Model;
 using PDF_Office.ViewModels.Tools;
 using PDFSettings;
@@ -142,6 +143,13 @@ namespace PDF_Office.ViewModels.PropertyPanel.AnnotPanel
             }
         }
 
+        private bool _isMultiSelected = false;
+        public bool IsMultiSelected
+        {
+            get { return _isMultiSelected; }
+            set => SetProperty(ref _isMultiSelected, value);
+        }
+
         #endregion
 
         public AnnotAttribEvent AnnotEvent { get; set; }
@@ -224,25 +232,37 @@ namespace PDF_Office.ViewModels.PropertyPanel.AnnotPanel
                 var colorValue = (Color)color;
                 if (colorValue != null)
                 {
-                   
-                    switch (AnnotType)
+                    if(IsMultiSelected)
                     {
-                        case AnnotArgsType.AnnotHighlight:
-                            SampleTextBg = new SolidColorBrush(colorValue);
-                            SampleTextBg.Opacity = AnnotOpacity;
-                            break;
-                        case AnnotArgsType.AnnotUnderline:
-                        case AnnotArgsType.AnnotStrikeout:
-                        case AnnotArgsType.AnnotSquiggly:
-                        case AnnotArgsType.AnnotSticky:
-                            SelectColor = new SolidColorBrush(colorValue);
-                            SelectColor.Opacity = AnnotOpacity;
-                            break;
+                        foreach (var item in PropertyPanel.AnnotEvents)
+                        {
+                            item?.UpdateAttrib(AnnotAttrib.Color, colorValue);
+                            item?.UpdateAnnot();
+                        }
                     }
+                    else
+                    {
+                        switch (AnnotType)
+                        {
+                            case AnnotArgsType.AnnotHighlight:
+                                SampleTextBg = new SolidColorBrush(colorValue);
+                                SampleTextBg.Opacity = AnnotOpacity;
+                                break;
+                            case AnnotArgsType.AnnotUnderline:
+                            case AnnotArgsType.AnnotStrikeout:
+                            case AnnotArgsType.AnnotSquiggly:
+                            case AnnotArgsType.AnnotSticky:
+                                SelectColor = new SolidColorBrush(colorValue);
+                                SelectColor.Opacity = AnnotOpacity;
+                                break;
+                        }
 
-                    Dictionary<AnnotArgsType, object> changeData = new Dictionary<AnnotArgsType, object>();
-                    changeData[AnnotType] = color;
-                    PropertyPanel.DataChangedInvoke(this, changeData);
+                        Dictionary<AnnotArgsType, object> changeData = new Dictionary<AnnotArgsType, object>();
+                        changeData[AnnotType] = color;
+                        PropertyPanel.DataChangedInvoke(this, changeData);
+                    }
+                   
+                   
                 }
             }
         }
@@ -276,6 +296,7 @@ namespace PDF_Office.ViewModels.PropertyPanel.AnnotPanel
 
         public void OnNavigatedFrom(NavigationContext navigationContext)
         {
+            IsMultiSelected = false;
         }
 
 
@@ -289,7 +310,29 @@ namespace PDF_Office.ViewModels.PropertyPanel.AnnotPanel
                 AnnotEvent = PropertyPanel.AnnotEvent;
                 Annot = PropertyPanel.annot;
                 AnnotType = Annot.EventType;
-                GetAnnotProperty();
+
+                if (PropertyPanel.annotlists != null && PropertyPanel.annotlists.Count > 1)
+                {
+                    IsMultiSelected = true;
+                }
+                else
+                {
+                    IsMultiSelected = false;
+                }
+
+                if(IsMultiSelected)
+                {
+                    DefaultAnnotProperty annotProperty = SettingHelper.GetAnnotDefaultProperty(AnnotArgsType.AnnotHighlight);
+                    if (annotProperty != null)
+                    {
+                        SelectColor = new SolidColorBrush(annotProperty.ForgoundColor);
+                    }
+                }
+                else
+                {
+                    GetAnnotProperty();
+                }
+                
                 LoadPropertyHandler?.Invoke(null, Annot);
             }
 

+ 121 - 74
PDF Office/ViewModels/Tools/AnnotToolContentViewModel.Command.cs

@@ -137,80 +137,12 @@ namespace PDF_Office.ViewModels.Tools
                 var annot = e.AnnotItemsList[0];
                 if (annot != null)
                 {
-                    if(e.AnnotItemsList.Count == 1)
+                    if (e.AnnotItemsList.Count == 1)
                     {
                         //IsAnnotCreateReset:是否为创建注释的状态
                         if (e.IsAnnotCreateReset == false)
                         {
-                            switch (annot.EventType)
-                            {
-                                case AnnotArgsType.AnnotHighlight:
-                                    e.IsAnnotCreateReset = false;
-                                    GetHighLight(annot as TextHighlightAnnotArgs);
-                                    break;
-
-                                case AnnotArgsType.AnnotUnderline:
-                                    GetUnderLine(annot as TextUnderlineAnnotArgs);
-                                    break;
-
-                                case AnnotArgsType.AnnotStrikeout:
-                                    GetStrikeout(annot as TextStrikeoutAnnotArgs);
-                                    break;
-
-                                case AnnotArgsType.AnnotSquiggly:
-                                    GetSquiggly(annot as TextSquigglyAnnotArgs);
-                                    break;
-
-                                case AnnotArgsType.AnnotFreehand:
-                                    GetFreehand(annot as FreehandAnnotArgs);
-                                    break;
-
-                                case AnnotArgsType.AnnotFreeText:
-                                    GetFreetext(annot as FreeTextAnnotArgs);
-                                    break;
-
-                                case AnnotArgsType.AnnotSquare:
-                                    GetRect(annot as SquareAnnotArgs);
-                                    break;
-
-                                case AnnotArgsType.AnnotCircle:
-                                    GetCircle(annot as CircleAnnotArgs);
-                                    break;
-
-                                case AnnotArgsType.AnnotLine:
-                                    bool isLine = true;
-                                    if (e.Attribs.ContainsKey(AnnotAttrib.LineStart))
-                                    {
-                                        if ((C_LINE_TYPE)e.Attribs[AnnotAttrib.LineStart] != C_LINE_TYPE.LINETYPE_UNKNOWN && (C_LINE_TYPE)e.Attribs[AnnotAttrib.LineStart] != C_LINE_TYPE.LINETYPE_NONE)
-                                        {
-                                            isLine = false;
-                                        }
-                                    }
-                                    if (e.Attribs.ContainsKey(AnnotAttrib.LineEnd))
-                                    {
-                                        if ((C_LINE_TYPE)e.Attribs[AnnotAttrib.LineEnd] != C_LINE_TYPE.LINETYPE_UNKNOWN && (C_LINE_TYPE)e.Attribs[AnnotAttrib.LineEnd] != C_LINE_TYPE.LINETYPE_NONE)
-                                        {
-                                            isLine = false;
-                                        }
-                                    }
-
-                                    if (isLine)
-                                        GetArrowLine("Line", annot as LineAnnotArgs);
-                                    else
-                                        GetArrowLine("Arrow", annot as LineAnnotArgs);
-
-                                    break;
-
-                                case AnnotArgsType.AnnotLink:
-                                    //viewContentViewModel.IsCreateLink = false;
-                                    GetLink(annot as LinkAnnotArgs, e);
-
-                                    break;
-
-                                case AnnotArgsType.AnnotSticky:
-                                    GetStickyNote(annot as StickyAnnotArgs);
-                                    break;
-                            }
+                            GetSelectedAnnots(e);
                             //记录这次选中的注释,之后创建注释会跟随上次选中注释的属性值
                             PDFViewer.SetToolParam(annot);
                         }
@@ -220,7 +152,7 @@ namespace PDF_Office.ViewModels.Tools
                             {
                                 case AnnotArgsType.AnnotLink:
                                     //viewContentViewModel.IsCreateLink = false;
-                                    GetLink(annot as LinkAnnotArgs, e);
+                                    GetLink(e.AnnotItemsList, e);
                                     PDFViewer.SetToolParam(annot);
                                     break;
                             }
@@ -262,9 +194,31 @@ namespace PDF_Office.ViewModels.Tools
                     }
                     else
                     {
+                        bool isDifferentAnnotTyle = false;
+                        var lastAnnot = annot;
+                        foreach (var item in e.AnnotItemsList)
+                        {
+                            if (lastAnnot.EventType != item.EventType)
+                            {
+                                if (isShapAnnot(annot) == true && isShapAnnot(item) == true)
+                                {
+                                    lastAnnot = item;
+                                    continue;
+                                }
+
+                                lastAnnot = item;
+                                isDifferentAnnotTyle = true;
+                                break;
+                            }
+                        }
 
+
+                        if (isDifferentAnnotTyle)
+                            viewContentViewModel.SelectedPrpoertyPanel("PropertyPanelContent", null);
+                        else
+                            GetSelectedAnnots(e);
                     }
-                  
+
                 }
             }
             else
@@ -273,6 +227,94 @@ namespace PDF_Office.ViewModels.Tools
             }
         }
 
+        private bool isShapAnnot(AnnotHandlerEventArgs annot)
+        {
+            if (annot.EventType == AnnotArgsType.AnnotCircle ||
+                annot.EventType == AnnotArgsType.AnnotSquare ||
+                annot.EventType == AnnotArgsType.AnnotLine
+                )
+            {
+                return true;
+            }
+            else
+            {
+                return false;
+            }
+        }
+
+        private void GetSelectedAnnots(AnnotAttribEvent e)
+        {
+            var annot = e.AnnotItemsList[0];
+            switch (annot.EventType)
+            {
+                case AnnotArgsType.AnnotHighlight:
+                    GetHighLight(e.AnnotItemsList);
+                    break;
+
+                case AnnotArgsType.AnnotUnderline:
+                    GetUnderLine(e.AnnotItemsList);
+                    break;
+
+                case AnnotArgsType.AnnotStrikeout:
+                    GetStrikeout(e.AnnotItemsList);
+                    break;
+
+                case AnnotArgsType.AnnotSquiggly:
+                    GetSquiggly(e.AnnotItemsList);
+                    break;
+
+                case AnnotArgsType.AnnotFreehand:
+                    GetFreehand(e.AnnotItemsList);
+                    break;
+
+                case AnnotArgsType.AnnotFreeText:
+                    GetFreetext(e.AnnotItemsList);
+                    break;
+
+                case AnnotArgsType.AnnotSquare:
+                    GetRect(e.AnnotItemsList);
+                    break;
+
+                case AnnotArgsType.AnnotCircle:
+                    GetCircle(e.AnnotItemsList);
+                    break;
+
+                case AnnotArgsType.AnnotLine:
+                    bool isLine = true;
+                    if (e.Attribs.ContainsKey(AnnotAttrib.LineStart))
+                    {
+                        if ((C_LINE_TYPE)e.Attribs[AnnotAttrib.LineStart] != C_LINE_TYPE.LINETYPE_UNKNOWN && (C_LINE_TYPE)e.Attribs[AnnotAttrib.LineStart] != C_LINE_TYPE.LINETYPE_NONE)
+                        {
+                            isLine = false;
+                        }
+                    }
+                    if (e.Attribs.ContainsKey(AnnotAttrib.LineEnd))
+                    {
+                        if ((C_LINE_TYPE)e.Attribs[AnnotAttrib.LineEnd] != C_LINE_TYPE.LINETYPE_UNKNOWN && (C_LINE_TYPE)e.Attribs[AnnotAttrib.LineEnd] != C_LINE_TYPE.LINETYPE_NONE)
+                        {
+                            isLine = false;
+                        }
+                    }
+
+                    if (isLine)
+                        GetArrowLine("Line", e.AnnotItemsList);
+                    else
+                        GetArrowLine("Arrow", e.AnnotItemsList);
+
+                    break;
+
+                case AnnotArgsType.AnnotLink:
+                    //viewContentViewModel.IsCreateLink = false;
+                    GetLink(e.AnnotItemsList, e);
+
+                    break;
+
+                case AnnotArgsType.AnnotSticky:
+                    GetStickyNote(e.AnnotItemsList);
+                    break;
+            }
+        }
+
         //在注释工具的状态下,右键菜单
         private void PDFViewer_AnnotCommandHandler(object sender, AnnotCommandArgs e)
         {
@@ -328,7 +370,8 @@ namespace PDF_Office.ViewModels.Tools
 
             SnapshotEditMenuViewModel.SnapToolArgs = snapToolArgs;
             SnapshotEditMenuViewModel.PDFViewer = PDFViewer;
-            SnapshotEditMenuViewModel.SnapToolEvent += SnapshotEditMenuViewModel_SnapToolEvent; ;
+            SnapshotEditMenuViewModel.SnapToolEvent -= SnapshotEditMenuViewModel_SnapToolEvent; ;
+            SnapshotEditMenuViewModel.SnapToolEvent += SnapshotEditMenuViewModel_SnapToolEvent;
             var popMenu = App.Current.FindResource("SnapshotContextMenu") as ContextMenu;
 
             if (e.HitSnapshotTool && e.SnapshotRect.Width > 0 && e.SnapshotRect.Height > 0)
@@ -415,6 +458,10 @@ namespace PDF_Office.ViewModels.Tools
 
                             default:
                                 BtnSelecttoolIsChecked = false;
+                                BtnHandIsChecked = true;
+                                PDFViewer.EnableZoom(true);
+                                PDFViewer.EnableScroll(true);
+
                                 break;
                         }
                     }
@@ -467,7 +514,7 @@ namespace PDF_Office.ViewModels.Tools
 
                         case ActionType.Modify:
                             isTabItemAnnotation = IsBOTATabItemShow(out bOTAContentViewModel, out bOTAContent, "TabItemAnnotation");
-                            if (isTabItemAnnotation)
+                            if (bOTAContent.TabItemAnnotation.IsSelected)
                             {
                                 AnnotationContentViewModel viewModel = GetAnnotationContentViewModel(bOTAContentViewModel);
 

+ 137 - 96
PDF Office/ViewModels/Tools/AnnotToolContentViewModel.Function.cs

@@ -224,12 +224,12 @@ namespace PDF_Office.ViewModels.Tools
         /// 高亮注释
         /// </summary>
         /// <returns></returns>
-        private AnnotHandlerEventArgs GetHighLight(TextHighlightAnnotArgs selectedhighlightArgs = null)
+        private AnnotHandlerEventArgs GetHighLight(List<AnnotHandlerEventArgs> selectedArgs = null)
         {
             Dictionary<AnnotAttrib, object> annotAttribsList = new Dictionary<AnnotAttrib, object>();
             TextHighlightAnnotArgs highlightArgs = null;
 
-            if (selectedhighlightArgs == null)
+            if (selectedArgs == null || selectedArgs.Count == 0)
             {
                 highlightArgs = new TextHighlightAnnotArgs();
                 highlightArgs.Color = Color.FromRgb(0xFF, 0xBB, 0x00);
@@ -241,21 +241,24 @@ namespace PDF_Office.ViewModels.Tools
                     highlightArgs.Transparency = annotProperty.Opacity;
                     highlightArgs.Content = annotProperty.NoteText;
                 }
+
+                if (highlightArgs != null)
+                {
+                    selectedArgs = new List<AnnotHandlerEventArgs>();
+                    selectedArgs.Add(highlightArgs);
+                }
+
             }
             else
             {
-                highlightArgs = selectedhighlightArgs;
+                highlightArgs = selectedArgs[0] as TextHighlightAnnotArgs;
             }
 
             annotAttribsList[AnnotAttrib.Color] = highlightArgs.Color;
             annotAttribsList[AnnotAttrib.Transparency] = highlightArgs.Transparency;
             annotAttribsList[AnnotAttrib.NoteText] = highlightArgs.Content;
 
-            List<AnnotHandlerEventArgs> highlightArgsList = new List<AnnotHandlerEventArgs>();
-            if (highlightArgs != null)
-                highlightArgsList.Add(highlightArgs);
-
-            AddToPropertyPanel("TextAnnotProperty", "HighLight", highlightArgsList, annotAttribsList);
+            AddToPropertyPanel("TextAnnotProperty", "HighLight", selectedArgs, annotAttribsList);
             return highlightArgs;
         }
 
@@ -265,7 +268,7 @@ namespace PDF_Office.ViewModels.Tools
         /// <param name="selectedLinkAnnotArgs"></param>
         /// <param name="annotAttribEvent"></param>
         /// <returns></returns>
-        public AnnotHandlerEventArgs GetLink(LinkAnnotArgs selectedLinkAnnotArgs = null, AnnotAttribEvent annotAttribEvent = null)
+        public AnnotHandlerEventArgs GetLink(List<AnnotHandlerEventArgs> selectedArgs = null, AnnotAttribEvent annotAttribEvent = null)
         {
             Dictionary<AnnotAttrib, object> annotAttribsList = new Dictionary<AnnotAttrib, object>();
             LinkAnnotArgs linkArgs = new LinkAnnotArgs();
@@ -274,9 +277,14 @@ namespace PDF_Office.ViewModels.Tools
             {
             }
 
-            if (selectedLinkAnnotArgs != null)
+
+            if (selectedArgs != null && selectedArgs.Count > 1)
             {
-                linkArgs = selectedLinkAnnotArgs;
+                if (linkArgs != null)
+                {
+                    selectedArgs = new List<AnnotHandlerEventArgs>();
+                    selectedArgs.Add(linkArgs);
+                }
             }
             else
             {
@@ -289,11 +297,8 @@ namespace PDF_Office.ViewModels.Tools
             annotAttribsList[AnnotAttrib.LinkUri] = linkArgs.URI;
             annotAttribsList[AnnotAttrib.LinkDestIndx] = linkArgs.DestIndex;
 
-            List<AnnotHandlerEventArgs> linkArgsList = new List<AnnotHandlerEventArgs>();
-            if (linkArgs != null)
-                linkArgsList.Add(linkArgs);
 
-            AddToPropertyPanel("LinkAnnotProperty", "Link", linkArgsList, annotAttribsList, annotAttribEvent);
+            AddToPropertyPanel("LinkAnnotProperty", "Link", selectedArgs, annotAttribsList, annotAttribEvent);
             return linkArgs;
         }
 
@@ -302,12 +307,12 @@ namespace PDF_Office.ViewModels.Tools
         /// </summary>
         /// <param name="selectedunderlineArgs"></param>
         /// <returns></returns>
-        private AnnotHandlerEventArgs GetUnderLine(TextUnderlineAnnotArgs selectedunderlineArgs = null)
+        private AnnotHandlerEventArgs GetUnderLine(List<AnnotHandlerEventArgs> selectedArgs = null)
         {
             Dictionary<AnnotAttrib, object> annotAttribsList = new Dictionary<AnnotAttrib, object>();
             TextUnderlineAnnotArgs underlineArgs = null;
 
-            if (selectedunderlineArgs == null)
+            if (selectedArgs == null || selectedArgs.Count == 0)
             {
                 underlineArgs = new TextUnderlineAnnotArgs();
                 underlineArgs.Color = Color.FromRgb(0x12, 0xFD, 0xFF);
@@ -319,21 +324,23 @@ namespace PDF_Office.ViewModels.Tools
                     underlineArgs.Transparency = annotProperty.Opacity;
                     underlineArgs.Content = annotProperty.NoteText;
                 }
+
+                if (underlineArgs != null)
+                {
+                    selectedArgs = new List<AnnotHandlerEventArgs>();
+                    selectedArgs.Add(underlineArgs);
+                }
             }
             else
             {
-                underlineArgs = selectedunderlineArgs;
+                underlineArgs = selectedArgs[0] as TextUnderlineAnnotArgs;
             }
 
             annotAttribsList[AnnotAttrib.Color] = underlineArgs.Color;
             annotAttribsList[AnnotAttrib.Transparency] = underlineArgs.Transparency;
             annotAttribsList[AnnotAttrib.NoteText] = underlineArgs.Content;
 
-            List<AnnotHandlerEventArgs> underlineArgsList = new List<AnnotHandlerEventArgs>();
-            if (underlineArgs != null)
-                underlineArgsList.Add(underlineArgs);
-
-            AddToPropertyPanel("TextAnnotProperty", "UnderLine", underlineArgsList, annotAttribsList);
+            AddToPropertyPanel("TextAnnotProperty", "UnderLine", selectedArgs, annotAttribsList);
             return underlineArgs;
         }
 
@@ -342,12 +349,12 @@ namespace PDF_Office.ViewModels.Tools
         /// </summary>
         /// <param name="selectedsquigglyArgs"></param>
         /// <returns></returns>
-        private AnnotHandlerEventArgs GetSquiggly(TextSquigglyAnnotArgs selectedsquigglyArgs = null)
+        private AnnotHandlerEventArgs GetSquiggly(List<AnnotHandlerEventArgs> selectedArgs = null)
         {
             Dictionary<AnnotAttrib, object> annotAttribsList = new Dictionary<AnnotAttrib, object>();
             TextSquigglyAnnotArgs squigglyArgs = null;
 
-            if (selectedsquigglyArgs == null)
+            if (selectedArgs == null || selectedArgs.Count == 0)
             {
                 squigglyArgs = new TextSquigglyAnnotArgs();
                 squigglyArgs.Color = Color.FromRgb(0xFF, 0x87, 0x16);
@@ -359,21 +366,23 @@ namespace PDF_Office.ViewModels.Tools
                     squigglyArgs.Transparency = annotProperty.Opacity;
                     squigglyArgs.Content = annotProperty.NoteText;
                 }
+
+                if (squigglyArgs != null)
+                {
+                    selectedArgs = new List<AnnotHandlerEventArgs>();
+                    selectedArgs.Add(squigglyArgs);
+                }
             }
             else
             {
-                squigglyArgs = selectedsquigglyArgs;
+                squigglyArgs = selectedArgs[0] as TextSquigglyAnnotArgs;
             }
 
             annotAttribsList[AnnotAttrib.Color] = squigglyArgs.Color;
             annotAttribsList[AnnotAttrib.Transparency] = squigglyArgs.Transparency;
             annotAttribsList[AnnotAttrib.NoteText] = squigglyArgs.Content;
 
-            List<AnnotHandlerEventArgs> squigglyArgsList = new List<AnnotHandlerEventArgs>();
-            if (squigglyArgs != null)
-                squigglyArgsList.Add(squigglyArgs);
-
-            AddToPropertyPanel("TextAnnotProperty", "Squiggly", squigglyArgsList, annotAttribsList);
+            AddToPropertyPanel("TextAnnotProperty", "Squiggly", selectedArgs, annotAttribsList);
             return squigglyArgs;
         }
 
@@ -382,12 +391,12 @@ namespace PDF_Office.ViewModels.Tools
         /// </summary>
         /// <param name="selectedstrikeoutArgs"></param>
         /// <returns></returns>
-        private AnnotHandlerEventArgs GetStrikeout(TextStrikeoutAnnotArgs selectedstrikeoutArgs = null)
+        private AnnotHandlerEventArgs GetStrikeout(List<AnnotHandlerEventArgs> selectedArgs = null)
         {
             Dictionary<AnnotAttrib, object> annotAttribsList = new Dictionary<AnnotAttrib, object>();
             TextStrikeoutAnnotArgs strikeoutArgs = null;
 
-            if (selectedstrikeoutArgs == null)
+            if (selectedArgs == null || selectedArgs.Count == 0)
             {
                 strikeoutArgs = new TextStrikeoutAnnotArgs();
                 strikeoutArgs.Color = Color.FromRgb(0xFF, 0x3B, 0x30);
@@ -399,21 +408,23 @@ namespace PDF_Office.ViewModels.Tools
                     strikeoutArgs.Transparency = annotProperty.Opacity;
                     strikeoutArgs.Content = annotProperty.NoteText;
                 }
+
+                if (strikeoutArgs != null)
+                {
+                    selectedArgs = new List<AnnotHandlerEventArgs>();
+                    selectedArgs.Add(strikeoutArgs);
+                }
             }
             else
             {
-                strikeoutArgs = selectedstrikeoutArgs;
+                strikeoutArgs = selectedArgs[0] as TextStrikeoutAnnotArgs;
             }
 
             annotAttribsList[AnnotAttrib.Color] = strikeoutArgs.Color;
             annotAttribsList[AnnotAttrib.Transparency] = strikeoutArgs.Transparency;
             annotAttribsList[AnnotAttrib.NoteText] = strikeoutArgs.Content;
 
-            List<AnnotHandlerEventArgs> strikeoutArgsList = new List<AnnotHandlerEventArgs>();
-            if (strikeoutArgs != null)
-                strikeoutArgsList.Add(strikeoutArgs);
-
-            AddToPropertyPanel("TextAnnotProperty", "Strikeout", strikeoutArgsList, annotAttribsList);
+            AddToPropertyPanel("TextAnnotProperty", "Strikeout", selectedArgs, annotAttribsList);
             return strikeoutArgs;
         }
 
@@ -422,12 +433,12 @@ namespace PDF_Office.ViewModels.Tools
         /// </summary>
         /// <param name="selectedfreehandArgs"></param>
         /// <returns></returns>
-        private AnnotHandlerEventArgs GetFreehand(FreehandAnnotArgs selectedfreehandArgs = null)
+        private AnnotHandlerEventArgs GetFreehand(List<AnnotHandlerEventArgs> selectedArgs = null)
         {
             Dictionary<AnnotAttrib, object> annotAttribsList = new Dictionary<AnnotAttrib, object>();
             FreehandAnnotArgs freehandArgs = null;
 
-            if (selectedfreehandArgs == null)
+            if (selectedArgs == null || selectedArgs.Count == 0)
             {
                 freehandArgs = new FreehandAnnotArgs();
                 freehandArgs.InkColor = Color.FromRgb(0x38, 0xE0, 0x2E);
@@ -441,10 +452,16 @@ namespace PDF_Office.ViewModels.Tools
                     freehandArgs.LineWidth = annotProperty.Thickness;
                     freehandArgs.Content = annotProperty.NoteText;
                 }
+
+                if (freehandArgs != null)
+                {
+                    selectedArgs = new List<AnnotHandlerEventArgs>();
+                    selectedArgs.Add(freehandArgs);
+                }
             }
             else
             {
-                freehandArgs = selectedfreehandArgs;
+                freehandArgs = selectedArgs[0] as FreehandAnnotArgs;
             }
 
             annotAttribsList[AnnotAttrib.Color] = freehandArgs.InkColor;
@@ -452,11 +469,7 @@ namespace PDF_Office.ViewModels.Tools
             annotAttribsList[AnnotAttrib.Thickness] = freehandArgs.LineWidth;
             annotAttribsList[AnnotAttrib.NoteText] = freehandArgs.Content;
 
-            List<AnnotHandlerEventArgs> freehandArgsList = new List<AnnotHandlerEventArgs>();
-            if (freehandArgs != null)
-                freehandArgsList.Add(freehandArgs);
-
-            AddToPropertyPanel("FreehandAnnotProperty", "Freehand", freehandArgsList, annotAttribsList);
+            AddToPropertyPanel("FreehandAnnotProperty", "Freehand", selectedArgs, annotAttribsList);
             return freehandArgs;
         }
 
@@ -465,13 +478,13 @@ namespace PDF_Office.ViewModels.Tools
         /// </summary>
         /// <param name="selectedfreetextArgs"></param>
         /// <returns></returns>
-        private AnnotHandlerEventArgs GetFreetext(FreeTextAnnotArgs selectedfreetextArgs = null)
+        private AnnotHandlerEventArgs GetFreetext(List<AnnotHandlerEventArgs> selectedArgs = null)
         {
             Dictionary<AnnotAttrib, object> annotAttribsList = new Dictionary<AnnotAttrib, object>();
             FreeTextAnnotArgs freetextArgs = null;
             TextAlignment textAlignment;
 
-            if (selectedfreetextArgs == null)
+            if (selectedArgs == null || selectedArgs.Count == 0)
             {
                 freetextArgs = new FreeTextAnnotArgs();
                 freetextArgs.Align = TextAlignment.Left;
@@ -508,10 +521,16 @@ namespace PDF_Office.ViewModels.Tools
                     textAlignment = TextAlignment.Center;
                 else
                     textAlignment = TextAlignment.Right;
+
+                if (freetextArgs != null)
+                {
+                    selectedArgs = new List<AnnotHandlerEventArgs>();
+                    selectedArgs.Add(freetextArgs);
+                }
             }
             else
             {
-                freetextArgs = selectedfreetextArgs;
+                freetextArgs = selectedArgs[0] as FreeTextAnnotArgs;
                 textAlignment = freetextArgs.Align;
             }
 
@@ -527,11 +546,7 @@ namespace PDF_Office.ViewModels.Tools
             annotAttribsList[AnnotAttrib.TextAlign] = textAlignment;
             annotAttribsList[AnnotAttrib.NoteText] = freetextArgs.TextContent;
 
-            List<AnnotHandlerEventArgs> freetextArgsList = new List<AnnotHandlerEventArgs>();
-            if (freetextArgs != null)
-                freetextArgsList.Add(freetextArgs);
-
-            AddToPropertyPanel("FreetextAnnotProperty", "Freetext", freetextArgsList, annotAttribsList);
+            AddToPropertyPanel("FreetextAnnotProperty", "Freetext", selectedArgs, annotAttribsList);
             return freetextArgs;
         }
 
@@ -540,12 +555,12 @@ namespace PDF_Office.ViewModels.Tools
         /// </summary>
         /// <param name="selectedStickyArgs"></param>
         /// <returns></returns>
-        private AnnotHandlerEventArgs GetStickyNote(StickyAnnotArgs selectedStickyArgs = null)
+        private AnnotHandlerEventArgs GetStickyNote(List<AnnotHandlerEventArgs> selectedArgs = null)
         {
             Dictionary<AnnotAttrib, object> annotAttribsList = new Dictionary<AnnotAttrib, object>();
             StickyAnnotArgs stickyAnnotArgs = new StickyAnnotArgs();
 
-            if (selectedStickyArgs == null)
+            if (selectedArgs == null || selectedArgs.Count == 0)
             {
                 stickyAnnotArgs.Color = Color.FromRgb(0xFF, 0x81, 0x33);
                 stickyAnnotArgs.StickyNote = string.Empty;
@@ -557,10 +572,16 @@ namespace PDF_Office.ViewModels.Tools
                     stickyAnnotArgs.StickyNote = annotProperty.NoteText;
                     stickyAnnotArgs.Transparency = annotProperty.Opacity;
                 }
+
+                if (stickyAnnotArgs != null)
+                {
+                    selectedArgs = new List<AnnotHandlerEventArgs>();
+                    selectedArgs.Add(stickyAnnotArgs);
+                }
             }
             else
             {
-                stickyAnnotArgs = selectedStickyArgs;
+                stickyAnnotArgs = selectedArgs[0] as StickyAnnotArgs;
             }
 
             annotAttribsList[AnnotAttrib.Color] = stickyAnnotArgs.Color;
@@ -572,7 +593,7 @@ namespace PDF_Office.ViewModels.Tools
             if (stickyAnnotArgs != null)
                 stickyAnnotArgsList.Add(stickyAnnotArgs);
 
-            AddToPropertyPanel("StickyNoteProperty", "StickyNote", stickyAnnotArgsList, annotAttribsList);
+            AddToPropertyPanel("StickyNoteProperty", "StickyNote", selectedArgs, annotAttribsList);
             return stickyAnnotArgs;
         }
 
@@ -581,12 +602,12 @@ namespace PDF_Office.ViewModels.Tools
         /// </summary>
         /// <param name="selectedsquareArgs"></param>
         /// <returns></returns>
-        private AnnotHandlerEventArgs GetRect(SquareAnnotArgs selectedsquareArgs = null)
+        private AnnotHandlerEventArgs GetRect(List<AnnotHandlerEventArgs> selectedArgs = null)
         {
             Dictionary<AnnotAttrib, object> annotAttribsList = new Dictionary<AnnotAttrib, object>();
             SquareAnnotArgs squareArgs = null;
 
-            if (selectedsquareArgs == null)
+            if (selectedArgs == null || selectedArgs.Count == 0)
             {
                 squareArgs = new SquareAnnotArgs();
 
@@ -619,10 +640,16 @@ namespace PDF_Office.ViewModels.Tools
                     squareArgs.Transparency = annotProperty.Opacity;
                     squareArgs.Content = annotProperty.NoteText;
                 }
+
+                if (squareArgs != null)
+                {
+                    selectedArgs = new List<AnnotHandlerEventArgs>();
+                    selectedArgs.Add(squareArgs);
+                }
             }
             else
             {
-                squareArgs = selectedsquareArgs;
+                squareArgs = selectedArgs[0] as SquareAnnotArgs;
             }
 
             annotAttribsList[AnnotAttrib.Color] = squareArgs.LineColor;
@@ -632,11 +659,7 @@ namespace PDF_Office.ViewModels.Tools
             annotAttribsList[AnnotAttrib.Transparency] = squareArgs.Transparency;
             annotAttribsList[AnnotAttrib.NoteText] = squareArgs.Content;
 
-            List<AnnotHandlerEventArgs> squareArgsList = new List<AnnotHandlerEventArgs>();
-            if (squareArgs != null)
-                squareArgsList.Add(squareArgs);
-
-            AddToPropertyPanel("SharpsAnnotProperty", "Rect", squareArgsList, annotAttribsList);
+            AddToPropertyPanel("SharpsAnnotProperty", "Rect", selectedArgs, annotAttribsList);
             return squareArgs;
         }
 
@@ -645,12 +668,12 @@ namespace PDF_Office.ViewModels.Tools
         /// </summary>
         /// <param name="selectedcircleAnnotArgs"></param>
         /// <returns></returns>
-        private AnnotHandlerEventArgs GetCircle(CircleAnnotArgs selectedcircleAnnotArgs = null)
+        private AnnotHandlerEventArgs GetCircle(List<AnnotHandlerEventArgs> selectedArgs = null)
         {
             Dictionary<AnnotAttrib, object> annotAttribsList = new Dictionary<AnnotAttrib, object>();
             CircleAnnotArgs circleAnnotArgs = null;
 
-            if (selectedcircleAnnotArgs == null)
+            if (selectedArgs == null || selectedArgs.Count == 0)
             {
                 circleAnnotArgs = new CircleAnnotArgs();
                 circleAnnotArgs.LineColor = Colors.Red;
@@ -681,10 +704,16 @@ namespace PDF_Office.ViewModels.Tools
                     circleAnnotArgs.Transparency = annotProperty.Opacity;
                     circleAnnotArgs.Content = annotProperty.NoteText;
                 }
+
+                if (circleAnnotArgs != null)
+                {
+                    selectedArgs = new List<AnnotHandlerEventArgs>();
+                    selectedArgs.Add(circleAnnotArgs);
+                }
             }
             else
             {
-                circleAnnotArgs = selectedcircleAnnotArgs;
+                circleAnnotArgs = selectedArgs[0] as CircleAnnotArgs;
             }
 
             annotAttribsList[AnnotAttrib.Color] = circleAnnotArgs.LineColor;
@@ -694,11 +723,7 @@ namespace PDF_Office.ViewModels.Tools
             annotAttribsList[AnnotAttrib.Transparency] = circleAnnotArgs.Transparency;
             annotAttribsList[AnnotAttrib.NoteText] = circleAnnotArgs.Content;
 
-            List<AnnotHandlerEventArgs> circleAnnotArgsList = new List<AnnotHandlerEventArgs>();
-            if (circleAnnotArgs != null)
-                circleAnnotArgsList.Add(circleAnnotArgs);
-
-            AddToPropertyPanel("SharpsAnnotProperty", "Circle", circleAnnotArgsList, annotAttribsList);
+            AddToPropertyPanel("SharpsAnnotProperty", "Circle", selectedArgs, annotAttribsList);
             return circleAnnotArgs;
         }
 
@@ -708,12 +733,12 @@ namespace PDF_Office.ViewModels.Tools
         /// <param name="TagStr"></param>
         /// <param name="selectedLineAnnotArgs"></param>
         /// <returns></returns>
-        private AnnotHandlerEventArgs GetArrowLine(string TagStr, LineAnnotArgs selectedLineAnnotArgs = null)
+        private AnnotHandlerEventArgs GetArrowLine(string TagStr, List<AnnotHandlerEventArgs> selectedArgs = null)
         {
             Dictionary<AnnotAttrib, object> annotAttribsList = new Dictionary<AnnotAttrib, object>();
             LineAnnotArgs lineArgs = new LineAnnotArgs();
 
-            if (selectedLineAnnotArgs == null)
+            if (selectedArgs == null || selectedArgs.Count == 0)
             {
                 lineArgs.LineColor = Colors.Red;
                 lineArgs.HeadLineType = C_LINE_TYPE.LINETYPE_NONE;
@@ -729,10 +754,16 @@ namespace PDF_Office.ViewModels.Tools
                 lineArgs.LineWidth = 1;
                 lineArgs.Transparency = 1;
                 lineArgs.Content = string.Empty;
+
+                if (lineArgs != null)
+                {
+                    selectedArgs = new List<AnnotHandlerEventArgs>();
+                    selectedArgs.Add(lineArgs);
+                }
             }
             else
             {
-                lineArgs = selectedLineAnnotArgs;
+                lineArgs = selectedArgs[0] as LineAnnotArgs;
             }
 
             DefaultAnnotProperty annotProperty = null;
@@ -774,11 +805,7 @@ namespace PDF_Office.ViewModels.Tools
             annotAttribsList[AnnotAttrib.Transparency] = lineArgs.Transparency;
             annotAttribsList[AnnotAttrib.NoteText] = lineArgs.Content;
 
-            List<AnnotHandlerEventArgs> lineArgsList = new List<AnnotHandlerEventArgs>();
-            if (lineArgs != null)
-                lineArgsList.Add(lineArgs);
-
-            AddToPropertyPanel("SharpsAnnotProperty", TagStr, lineArgsList, annotAttribsList);
+            AddToPropertyPanel("SharpsAnnotProperty", TagStr, selectedArgs, annotAttribsList);
             return lineArgs;
         }
 
@@ -849,6 +876,7 @@ namespace PDF_Office.ViewModels.Tools
 
             SnapshotEditMenuViewModel.SnapToolArgs = snapshotArgs;
             SnapshotEditMenuViewModel.PDFViewer = PDFViewer;
+            SnapshotEditMenuViewModel.SnapToolEvent -= SnapshotEditMenuViewModel_SnapToolEvent;
             SnapshotEditMenuViewModel.SnapToolEvent += SnapshotEditMenuViewModel_SnapToolEvent;
 
             #region to do
@@ -879,22 +907,33 @@ namespace PDF_Office.ViewModels.Tools
 
             if (annots != null)
             {
-                if (annots.Count > 1)
-                {
-                    propertyPanel.annotlists = annots;
-                    propertyPanel.annot = annots[0];
-                }
-                else
-                {
-                    propertyPanel.annot = annots[0];
-                }
+                propertyPanel.annotlists = annots;
+                propertyPanel.annot = annots[0];
+            }
+            else
+            {
+                propertyPanel.annotlists = null;
+                propertyPanel.annot = null;
             }
 
             if (annotAttribsList != null)
             {
-                AnnotHandlerEventArgs annot = annots[0];
-                propertyPanel.AnnotEvent = AnnotAttribEvent.GetAnnotAttribEvent(annot, annotAttribsList);
-                if (annot is LinkAnnotArgs && annotAttribEvent != null)
+                if(annots.Count > 1)
+                {
+                    if (propertyPanel.AnnotEvents == null)
+                        propertyPanel.AnnotEvents = new List<AnnotAttribEvent>();
+
+                    propertyPanel.AnnotEvents.Clear();
+
+                    foreach (var itemAnnot in annots)
+                    {
+                        var eventitem = AnnotAttribEvent.GetAnnotAttribEvent(itemAnnot, annotAttribsList);
+                        propertyPanel.AnnotEvents.Add(eventitem);
+                    }
+                }
+
+                propertyPanel.AnnotEvent = AnnotAttribEvent.GetAnnotAttribEvent(annots[0], annotAttribsList);
+                if (annots[0] is LinkAnnotArgs && annotAttribEvent != null)
                 {
                     propertyPanel.AnnotEvent = annotAttribEvent;
                 }
@@ -1280,7 +1319,9 @@ namespace PDF_Office.ViewModels.Tools
                         linkArgs.DestIndex = annotCommand.PageIndex;
                         PDFViewer.CreatePageAnnot(annotCommand.PageIndex, linkArgs);
                         BtnLinkIsChecked = true;
-                        AnnotHandlerEventArgs annotArgs = GetLink(linkArgs);
+                        List<AnnotHandlerEventArgs> lists = new List<AnnotHandlerEventArgs>();
+                        lists.Add(linkArgs);
+                        AnnotHandlerEventArgs annotArgs = GetLink(lists);
                         PDFViewer.SetMouseMode(MouseModes.AnnotCreate);
                         PDFViewer.SetToolParam(annotArgs);
                         viewContentViewModel.IsPropertyOpen = true;

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

@@ -21,6 +21,7 @@ namespace PDF_Office.ViewModels.Tools
     public class AnnotPropertyPanel
     {
         public AnnotAttribEvent AnnotEvent { get; set; }
+        public List<AnnotAttribEvent> AnnotEvents = new List<AnnotAttribEvent>();
         public AnnotHandlerEventArgs annot;
         public List<AnnotHandlerEventArgs> annotlists;
 

+ 3 - 1
PDF Office/ViewModels/ViewContentViewModel.cs

@@ -591,7 +591,9 @@ namespace PDF_Office.ViewModels
                     linkArgs.PageIndex = annotCommand.PageIndex;
                     //linkArgs.InvokeLinkSaveCalled(this, EventArgs.Empty);
                     this.IsRightMenuCreateLink = true;
-                    AnnotHandlerEventArgs annotArgs = toolContentViewModel.GetLink(linkArgs);
+                    List<AnnotHandlerEventArgs> lists = new List<AnnotHandlerEventArgs>();
+                    lists.Add(linkArgs);
+                    AnnotHandlerEventArgs annotArgs = toolContentViewModel.GetLink(lists);
                     PDFViewer.SetMouseMode(MouseModes.AnnotCreate);
                     PDFViewer.SetToolParam(annotArgs);
                     this.IsPropertyOpen = true;

+ 2 - 2
PDF Office/Views/BOTA/AnnotationListItem.xaml

@@ -358,8 +358,8 @@
 
             <Image
                 Name="ImageContext"
-                Grid.Row="1" Stretch="Fill "
-                Source="{Binding WriteableBitmap}" />
+                Grid.Row="1"
+                Source="{Binding WriteableBitmap}"  MinHeight="12" />
             <TextBlock
                 Name="TxbContent"
                 Grid.Row="2"

+ 13 - 4
PDF Office/Views/BOTA/AnnotationListItem.xaml.cs

@@ -78,15 +78,24 @@ namespace PDF_Office.Views.BOTA
 
                     if (args.WriteableBitmap.Width > 180)
                     {
-                        ImageContext.Stretch = Stretch.Fill;
+                        if (ImageContext.Stretch != Stretch.Fill)
+                        {
+                            ImageContext.Stretch = Stretch.Fill;
+                        }
                     }
-                    else if (args.WriteableBitmap.Width > 100)
+                    else if (args.WriteableBitmap.Height > 100)
                     {
-                        ImageContext.Stretch = Stretch.Fill;
+                        if (ImageContext.Stretch != Stretch.Fill)
+                        {
+                            ImageContext.Stretch = Stretch.Fill;
+                        }
                     }
                     else
                     {
-                        ImageContext.Stretch = Stretch.None;
+                        if (ImageContext.Stretch != Stretch.None)
+                        {
+                            ImageContext.Stretch = Stretch.None;
+                        }
                     }
 
                     //var encoder = new PngBitmapEncoder();

+ 1 - 1
PDF Office/Views/Dialog/HomePageToolsDialogs/HomePagePictureToPDFDialog.xaml

@@ -168,7 +168,7 @@
                 </StackPanel>
             </Grid>
             <Grid Grid.Row="2">
-                <Button Height="40" Width="228" Background="Black" Command="{Binding ToPDFCommand}">
+                <Button Height="40" Width="228" Background="Black" Command="{Binding ToPDFCommand}" IsEnabled="{Binding ImageToPDFBtnIsEnable}">
                     <TextBlock Text="导出文档" FontSize="18" Foreground="White"/>
                 </Button>
             </Grid>

+ 5 - 0
PDF Office/Views/Dialog/HomePageToolsDialogs/HomePagePictureToPDFDialog.xaml.cs

@@ -10,6 +10,7 @@ using System.Collections;
 using System.Collections.Generic;
 using System.Data;
 using System.Diagnostics;
+using System.IO;
 using System.Windows;
 using System.Windows.Controls;
 using System.Windows.Input;
@@ -64,6 +65,7 @@ namespace PDF_Office.Views.Dialog.HomePageToolsDialogs
         private void RadioButton_Click(object sender, System.Windows.RoutedEventArgs e)
         {
             var radiobutton = sender as RadioButton;
+            viewModel.ImageToPDFBtnIsEnable = "True";
             switch (radiobutton.Name.ToString())
             {
                 case "NewFilesRadioButtom":
@@ -79,6 +81,9 @@ namespace PDF_Office.Views.Dialog.HomePageToolsDialogs
                 case "SelectFileNameRadioButton":
                     {
                         viewModel.pictureToPDFModel.Mode = HomePagePictureToPDFDialogModel.ToPDFFileMode.SelectFileName;
+                        if (!File.Exists(viewModel.SelectFileName)) {
+                            viewModel.ImageToPDFBtnIsEnable = "False";
+                        }
                     }
                     break;
                 default:

+ 14 - 9
PDF Office/Views/PropertyPanel/AnnotPanel/FreehandAnnotProperty.xaml

@@ -42,7 +42,9 @@
         <StackPanel>
             <TextBlock Name="AnnotTypeTitle" FontFamily="SegoeUI" FontWeight="Bold" FontSize="18" LineHeight="24" HorizontalAlignment="Left" Margin="10,8,0,0">Freehand</TextBlock>
 
-            <Border Width="128" Height="32" Margin="0,12,0,0" BorderThickness="1" BorderBrush="#FFE2E3E6">
+            <Border Width="128" Height="32" Margin="0,12,0,0" BorderThickness="1" BorderBrush="#FFE2E3E6"
+                    Visibility="{Binding IsMultiSelected,Converter={StaticResource InvertBoolToVisibleConvert}}"
+                    >
                 <Grid Name="ToolGrid">
                     <Grid.ColumnDefinitions>
                         <ColumnDefinition Width="*"></ColumnDefinition>
@@ -99,7 +101,9 @@
             </Border>
 
             
-            <Border Width="228" Height="100" BorderThickness="1" CornerRadius="2" BorderBrush="#DDDDDD" Background="White" Margin="0,8,0,0">
+            <Border Width="228" Height="100" BorderThickness="1" CornerRadius="2" BorderBrush="#DDDDDD" Background="White" Margin="0,8,0,0"
+                    Visibility="{Binding IsMultiSelected,Converter={StaticResource InvertBoolToVisibleConvert}}"
+                    >
                 <Grid>
                     <Path Name="FreehandPath" Fill="{Binding SelectColor}" Stroke="{Binding SelectColor}" StrokeThickness="{Binding ThicknessLine}" Visibility="{Binding IsPen,Converter={StaticResource BoolToVisible}}"
                   Data="M89.6572823,33.0006836 C92.423623,33.0142613 94.9660238,33.2143167 97.6072943,33.6499257 L98.4450428,33.7953737 C99.2868308,33.9487663 100.141867,
@@ -138,7 +142,9 @@
                         <RowDefinition Height="auto"/>
                         <RowDefinition/>
                     </Grid.RowDefinitions>
-                    <CompositeControl:SlidContent x:Name="layerThick" HorizontalAlignment="Right">
+                    <CompositeControl:SlidContent x:Name="layerThick" HorizontalAlignment="Right"
+                                          Visibility="{Binding IsMultiSelected,Converter={StaticResource InvertBoolToVisibleConvert}}"        
+                                                  >
                         <i:Interaction.Triggers>
                             <i:EventTrigger EventName="SelectedValueChanged">
                                 <i:InvokeCommandAction Command="{Binding SelectedOpacityValueCommand}" CommandParameter="{Binding ElementName=layerThick,Path=Value}"/>
@@ -229,7 +235,7 @@
                         <ColumnDefinition Width="*"></ColumnDefinition>
                         <ColumnDefinition Width="auto"></ColumnDefinition>
                     </Grid.ColumnDefinitions>
-                    <Slider Name="SlEraser" VerticalAlignment="Center" Margin="12,0,4,0"  Minimum="1" Maximum="12" IsSelectionRangeEnabled="True" IsMoveToPointEnabled="True"
+                    <Slider Name="SlEraser" VerticalAlignment="Center" Margin="12,0,4,0"  Minimum="1" Maximum="20" IsSelectionRangeEnabled="True" IsMoveToPointEnabled="True"
                             Value="{Binding EraseThicknessLine}"
                     Style="{StaticResource RoundThumbSlider}"  TickFrequency="1" IsSnapToTickEnabled="True" >
                         <Slider.Resources>
@@ -246,11 +252,10 @@
                                         <Setter Property="Padding" Value="10 0 0 0"/>
                                     </Style>
                                 </ComboBox.ItemContainerStyle>
-                                <ComboBoxItem Content="1" Height="32" VerticalContentAlignment="Center" Template="{StaticResource comboxitem}"/>
-                                <ComboBoxItem Content="3" Height="32" VerticalContentAlignment="Center" Template="{StaticResource comboxitem}"/>
-                                <ComboBoxItem Content="6" Height="32" VerticalContentAlignment="Center" Template="{StaticResource comboxitem}"/>
-                                <ComboBoxItem Content="9" Height="32" VerticalContentAlignment="Center" Template="{StaticResource comboxitem}"/>
-                                <ComboBoxItem Content="12" Height="32" VerticalContentAlignment="Center" Template="{StaticResource comboxitem}"/>
+                                <ComboBoxItem Content="5" Height="32" VerticalContentAlignment="Center" Template="{StaticResource comboxitem}"/>
+                                <ComboBoxItem Content="10" Height="32" VerticalContentAlignment="Center" Template="{StaticResource comboxitem}"/>
+                                <ComboBoxItem Content="15" Height="32" VerticalContentAlignment="Center" Template="{StaticResource comboxitem}"/>
+                                <ComboBoxItem Content="20" Height="32" VerticalContentAlignment="Center" Template="{StaticResource comboxitem}"/>
                                 <i:Interaction.Triggers>
                                     <i:EventTrigger EventName="SelectionChanged">
                                         <i:InvokeCommandAction Command="{Binding SetEraserThickCommand}"  CommandParameter="{Binding ElementName=CmbEraser,Path=SelectedItem}"/>

+ 8 - 3
PDF Office/Views/PropertyPanel/AnnotPanel/FreetextAnnotProperty.xaml

@@ -19,7 +19,7 @@
                 <ResourceDictionary Source="../../../Styles/SliderStyle.xaml"></ResourceDictionary>
                 <ResourceDictionary Source="../../../Styles/CustomBtnStyle.xaml"/>
             </ResourceDictionary.MergedDictionaries>
-
+            <Convert:InvertBoolToVisibleConvert x:Key="InvertBoolToVisibleConvert"/>
             <Convert:CheckToVisibleMutiConvert x:Key="CheckToVisibleMutiConvert"/>
             <Style x:Key="line1Style" TargetType="{x:Type Line}">
                 <Setter Property="Visibility">
@@ -52,7 +52,9 @@
     <Grid Background="#F3F3F3">
         <StackPanel>
             <TextBlock Name="AnnotTypeTitle" FontFamily="Segoe UI Semibold" FontWeight="SemiBold" FontSize="18" LineHeight="24" HorizontalAlignment="Left" Margin="10,8,0,0">Freetext</TextBlock>
-            <Border Width="228" Height="100" BorderThickness="1" CornerRadius="2" BorderBrush="#DDDDDD" Background="White" Margin="0,8,0,0">
+            <Border Width="228" Height="100" BorderThickness="1" CornerRadius="2" BorderBrush="#DDDDDD" Background="White" Margin="0,8,0,0"
+                     Visibility="{Binding IsMultiSelected,Converter={StaticResource InvertBoolToVisibleConvert}}"
+                    >
                 <Grid>
                     <Border Name="FreeTextBorder" HorizontalAlignment="Center" VerticalAlignment="Center" Padding="5"
                             Opacity="{Binding FillOpacity}"
@@ -372,7 +374,10 @@
                     <RowDefinition Height="auto"/>
                     <RowDefinition/>
                 </Grid.RowDefinitions>
-                <CompositeControl:SlidContent x:Name="layerThick" HorizontalAlignment="Right">
+                <TextBlock Text="Fill" VerticalAlignment="Center"/>
+                <CompositeControl:SlidContent x:Name="layerThick" HorizontalAlignment="Right"
+                    Visibility="{Binding IsMultiSelected,Converter={StaticResource InvertBoolToVisibleConvert}}"                           
+                                              >
                     <i:Interaction.Triggers>
                         <i:EventTrigger EventName="SelectedValueChanged">
                             <i:InvokeCommandAction Command="{Binding SelectedOpacityValueCommand}" CommandParameter="{Binding ElementName=layerThick,Path=Value}"/>

+ 15 - 5
PDF Office/Views/PropertyPanel/AnnotPanel/SharpsAnnotProperty.xaml

@@ -24,7 +24,7 @@
             <Convert:ColorToBrushConverter x:Key="ColorToBrushConvert" />
             <Convert:CheckToVisibleMutiConvert x:Key="CheckToVisibleMutiConvert" />
             <DashConvert:DashStyleConverter x:Key="DashStyleConverter" />
-
+            <Convert:InvertBoolToVisibleConvert x:Key="InvertBoolToVisibleConvert"/>
             <Style x:Key="line1Style" TargetType="{x:Type Line}">
                 <Setter Property="Visibility">
                     <Setter.Value>
@@ -76,7 +76,9 @@
                 Background="White"
                 BorderBrush="#DDDDDD"
                 BorderThickness="1"
-                CornerRadius="2">
+                CornerRadius="2"
+                Visibility="{Binding IsMultiSelected,Converter={StaticResource InvertBoolToVisibleConvert}}"
+                >
                 <Grid>
                     <Path
                         Name="SharpPath"
@@ -102,7 +104,9 @@
                 Height="32"
                 Margin="0,12,0,0"
                 BorderBrush="#FFE2E3E6"
-                BorderThickness="1">
+                BorderThickness="1" 
+                Visibility="{Binding IsMultiSelected,Converter={StaticResource InvertBoolToVisibleConvert}}"
+                >
                 <Grid Name="ToolGrid">
                     <Grid.ColumnDefinitions>
                         <ColumnDefinition Width="40.5" />
@@ -238,7 +242,10 @@
                     <RowDefinition Height="auto" />
                     <RowDefinition />
                 </Grid.RowDefinitions>
-                <CompositeControl:SlidContent x:Name="layerFill" HorizontalAlignment="Right">
+                <TextBlock Text="Fill" VerticalAlignment="Center"/>
+                <CompositeControl:SlidContent x:Name="layerFill" HorizontalAlignment="Right"
+                                              Visibility="{Binding IsMultiSelected,Converter={StaticResource InvertBoolToVisibleConvert}}"
+                                              >
                     <i:Interaction.Triggers>
                         <i:EventTrigger EventName="SelectedValueChanged">
                             <i:InvokeCommandAction Command="{Binding SelectedOpacityValueCommand}" CommandParameter="{Binding ElementName=layerFill,Path=Value}"/>
@@ -253,7 +260,10 @@
                     <RowDefinition Height="auto" />
                     <RowDefinition />
                 </Grid.RowDefinitions>
-                <CompositeControl:SlidContent x:Name="layerThick" HorizontalAlignment="Right" />
+                <TextBlock Text="Border" VerticalAlignment="Center"/>
+                <CompositeControl:SlidContent x:Name="layerThick" HorizontalAlignment="Right" 
+                                              Visibility="{Binding IsMultiSelected,Converter={StaticResource InvertBoolToVisibleConvert}}"
+                                              />
                 <CompositeControl:ColorContent x:Name="cusColor" Grid.Row="1" />
 
             </Grid>

+ 10 - 4
PDF Office/Views/PropertyPanel/AnnotPanel/StickyNoteProperty.xaml

@@ -8,6 +8,7 @@
              d:DataContext="{d:DesignInstance Type=AnnotPanel:StickyNotePropertyViewModel}"
              xmlns:CompositeControl="clr-namespace:PDF_Office.CustomControl.CompositeControl"
              xmlns:Convert="clr-namespace:PDF_Office.ViewModels.PropertyPanel.AnnotPanel"
+             xmlns:dataConvert="clr-namespace:PDF_Office.DataConvert"
              xmlns:i="http://schemas.microsoft.com/xaml/behaviors"
              mc:Ignorable="d" 
              Loaded="UserControl_Loaded"
@@ -20,7 +21,7 @@
                 <ResourceDictionary Source="../../../Styles/RadioButtonStyle.xaml" />
             </ResourceDictionary.MergedDictionaries>
             <Convert:AnnotArgsTypeConverter x:Key="AnnotArgsTypeConverter"/>
-
+            <dataConvert:InvertBoolToVisibleConvert x:Key="InvertBoolToVisibleConvert"/>
         </ResourceDictionary>
 
     </UserControl.Resources>
@@ -29,7 +30,9 @@
             <TextBlock Name="AnnotTypeTitle" FontFamily="Segoe UI" FontWeight="Bold" FontSize="18" LineHeight="24" HorizontalAlignment="Left" Margin="0,16,0,8"
                        Text="便签"
                        ></TextBlock>
-            <Border Width="228" Height="100" BorderThickness="1" CornerRadius="2" BorderBrush="#DDDDDD" Background="White" Margin="0,8,0,0">
+            <Border Width="228" Height="100" BorderThickness="1" CornerRadius="2" BorderBrush="#DDDDDD" Background="White" Margin="0,8,0,0"
+                    Visibility="{Binding IsMultiSelected,Converter={StaticResource InvertBoolToVisibleConvert}}"
+                    >
                 <Grid VerticalAlignment="Center" HorizontalAlignment="Center">
                     <Path Data="{Binding ExmpleData}" Fill="{Binding SharpColor}" Opacity="{Binding Transpent}"/>
                 </Grid>
@@ -40,7 +43,10 @@
                     <RowDefinition Height="auto"/>
                     <RowDefinition/>
                 </Grid.RowDefinitions>
-                <CompositeControl:SlidContent x:Name="SlidOpacity" HorizontalAlignment="Right">
+                <TextBlock Text="Color" VerticalAlignment="Center"/>
+                <CompositeControl:SlidContent x:Name="SlidOpacity" HorizontalAlignment="Right"
+                                              Visibility="{Binding IsMultiSelected,Converter={StaticResource InvertBoolToVisibleConvert}}"
+                                              >
                     <i:Interaction.Triggers>
                         <i:EventTrigger EventName="SelectedValueChanged">
                             <i:InvokeCommandAction Command="{Binding SelectedOpacityValueCommand}" CommandParameter="{Binding ElementName=SlidOpacity,Path=Value}"/>
@@ -49,7 +55,7 @@
                 </CompositeControl:SlidContent>
                 <CompositeControl:ColorContent Grid.Row="1" x:Name="cusColor" />
             </Grid>
-
+            <TextBlock Text="Style" Margin="0,20,0,10"/>
             <Grid>
                 <Grid.RowDefinitions>
                     <RowDefinition Height="*"/>

+ 8 - 4
PDF Office/Views/PropertyPanel/AnnotPanel/TextAnnotProperty.xaml

@@ -12,7 +12,7 @@
              xmlns:AnnotPanel="clr-namespace:PDF_Office.ViewModels.PropertyPanel.AnnotPanel"
              d:DataContext="{d:DesignInstance Type=AnnotPanel:TextAnnotPropertyViewModel}"
              xmlns:Convert="clr-namespace:PDF_Office.ViewModels.PropertyPanel.AnnotPanel"
-             
+             xmlns:convert="clr-namespace:PDF_Office.DataConvert"
              mc:Ignorable="d" 
              d:DesignHeight="450" d:DesignWidth="800">
     <UserControl.Resources>
@@ -21,7 +21,7 @@
                 <ResourceDictionary Source="../../../Styles/SliderStyle.xaml"></ResourceDictionary>
             </ResourceDictionary.MergedDictionaries>
             <Convert:AnnotArgsTypeConverter x:Key="AnnotArgsTypeConverter"/>
-
+            <convert:InvertBoolToVisibleConvert x:Key="InvertBoolToVisibleConvert"/>
         </ResourceDictionary>
       
     </UserControl.Resources>
@@ -30,7 +30,10 @@
             <TextBlock Name="AnnotTypeTitle" FontFamily="Segoe UI" FontWeight="Bold" FontSize="18" LineHeight="24" HorizontalAlignment="Left" Margin="0,16,0,8"
                        Text="{Binding AnnotTypeTitle}"
                        ></TextBlock>
-            <Border Width="228" Height="100" BorderThickness="1" CornerRadius="2" BorderBrush="#DDDDDD" Background="White" Margin="0,8,0,0">
+            
+            <Border Width="228" Height="100" BorderThickness="1" CornerRadius="2" BorderBrush="#DDDDDD" Background="White" Margin="0,8,0,0"
+                     Visibility="{Binding IsMultiSelected,Converter={StaticResource InvertBoolToVisibleConvert}}"
+                    >
                 <Grid>
                     <TextBlock Name="SampleText" Text="Sample" HorizontalAlignment="Center" VerticalAlignment="Center" FontWeight="Bold" FontFamily="Segoe UI" FontSize="18"
                              Background="{Binding SampleTextBg}" 
@@ -63,7 +66,8 @@
                     <RowDefinition Height="auto"/>
                     <RowDefinition/>
                 </Grid.RowDefinitions>
-                <CompositeControl:SlidContent x:Name="SlidOpacity" HorizontalAlignment="Right">
+                <CompositeControl:SlidContent x:Name="SlidOpacity" HorizontalAlignment="Right" 
+                                              Visibility="{Binding IsMultiSelected,Converter={StaticResource InvertBoolToVisibleConvert}}">
                     <i:Interaction.Triggers>
                         <i:EventTrigger EventName="SelectedValueChanged">
                             <i:InvokeCommandAction Command="{Binding SelectedValueChangedCommand}" CommandParameter="{Binding ElementName=SlidOpacity,Path=Value}"/>