|
@@ -28,6 +28,7 @@ using System.Windows.Input;
|
|
|
using PDF_Master.ViewModels.Tools.AnnotManager;
|
|
|
using ComPDFKit.Import;
|
|
|
using System.Windows.Markup;
|
|
|
+using ImTools;
|
|
|
|
|
|
namespace PDF_Master.ViewModels.Tools
|
|
|
{
|
|
@@ -265,7 +266,7 @@ namespace PDF_Master.ViewModels.Tools
|
|
|
//viewContentViewModel.IsCreateLink = false;
|
|
|
//e.IsAnnotCreateReset= true;
|
|
|
|
|
|
- if (BtnLinkIsChecked == false)
|
|
|
+ if (StrAnnotToolChecked == "Link")
|
|
|
{
|
|
|
propertyPanel.IsAddLink = false;
|
|
|
}
|
|
@@ -380,6 +381,11 @@ namespace PDF_Master.ViewModels.Tools
|
|
|
case AnnotArgsType.AnnotSticky:
|
|
|
customStickyPopup.GetCurrentAnnot = e.AnnotItemsList[0] as StickyAnnotArgs;
|
|
|
customStickyPopup.GetPDFViewer = PDFViewer;
|
|
|
+ propertyPanel.annot = e.AnnotItemsList[0];
|
|
|
+ var AnnotEvent = AnnotAttribEvent.GetAnnotAttribEvent(annot, annot.GetAnnotAttrib());
|
|
|
+ propertyPanel.AnnotEvents = null;
|
|
|
+ propertyPanel.AnnotEvent = AnnotEvent;
|
|
|
+ propertyPanel.annotlists = e.AnnotItemsList;
|
|
|
break;
|
|
|
|
|
|
case AnnotArgsType.AnnotLink:
|
|
@@ -388,6 +394,8 @@ namespace PDF_Master.ViewModels.Tools
|
|
|
PDFViewer.SetToolParam(annot);
|
|
|
break;
|
|
|
}
|
|
|
+ //GetSelectedAnnots(e);
|
|
|
+ //PDFViewer.SetToolParam(annot);
|
|
|
|
|
|
#region //TODO: 修改注释后,会作用到之后添加的注释中。因此先把此逻辑“创建注释后,会自动回到默认值”注释掉
|
|
|
|
|
@@ -490,7 +498,7 @@ namespace PDF_Master.ViewModels.Tools
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- if (BtnLinkIsChecked == false)
|
|
|
+ if (StrAnnotToolChecked == "Link")
|
|
|
{
|
|
|
if (PDFViewer.MouseMode != MouseModes.AnnotCreate)
|
|
|
{
|
|
@@ -865,6 +873,14 @@ namespace PDF_Master.ViewModels.Tools
|
|
|
{
|
|
|
case ActionType.Add:
|
|
|
|
|
|
+ if (editEvent.EditAnnotArgs is StickyAnnotArgs stickyAnnotArgs)
|
|
|
+ {
|
|
|
+ PDFViewer.SelectAnnotation(stickyAnnotArgs.PageIndex, stickyAnnotArgs.AnnotIndex);
|
|
|
+ }
|
|
|
+ if (editEvent.EditAnnotArgs is FreeTextAnnotArgs freeTextAnnotArgs)
|
|
|
+ {
|
|
|
+ PDFViewer.SelectAnnotation(freeTextAnnotArgs.PageIndex, freeTextAnnotArgs.AnnotIndex);
|
|
|
+ }
|
|
|
//BOTA
|
|
|
bool isTabItemAnnotation = IsBOTATabItemShow(out BOTAContentViewModel bOTAContentViewModel, out BOTAContent bOTAContent, "TabItemAnnotation");
|
|
|
|
|
@@ -1115,6 +1131,7 @@ namespace PDF_Master.ViewModels.Tools
|
|
|
{
|
|
|
foreach (AnnotArgsType argsType in e.Keys)
|
|
|
{
|
|
|
+ var key = ToolExpandDict.FirstOrDefault(q => q.Value == argsType);
|
|
|
switch (argsType)
|
|
|
{
|
|
|
case AnnotArgsType.AnnotHighlight:
|
|
@@ -1129,7 +1146,10 @@ namespace PDF_Master.ViewModels.Tools
|
|
|
//创建注释后,修改注释属性,可用于下次创建的注释
|
|
|
if (propertyPanel != null && propertyPanel.annot != null && PDFViewer.MouseMode == MouseModes.AnnotCreate)
|
|
|
{
|
|
|
- PDFViewer.SetToolParam(propertyPanel.annot);
|
|
|
+ if (StrAnnotToolChecked == key.Key)
|
|
|
+ {
|
|
|
+ PDFViewer.SetToolParam(propertyPanel.annot);
|
|
|
+ }
|
|
|
}
|
|
|
break;
|
|
|
|
|
@@ -1145,7 +1165,10 @@ namespace PDF_Master.ViewModels.Tools
|
|
|
//创建注释后,修改注释属性,可用于下次创建的注释
|
|
|
if (propertyPanel != null && propertyPanel.annot != null && PDFViewer.MouseMode == MouseModes.AnnotCreate)
|
|
|
{
|
|
|
- PDFViewer.SetToolParam(propertyPanel.annot);
|
|
|
+ if (StrAnnotToolChecked == key.Key)
|
|
|
+ {
|
|
|
+ PDFViewer.SetToolParam(propertyPanel.annot);
|
|
|
+ }
|
|
|
}
|
|
|
break;
|
|
|
|
|
@@ -1161,7 +1184,10 @@ namespace PDF_Master.ViewModels.Tools
|
|
|
//创建注释后,修改注释属性,可用于下次创建的注释
|
|
|
if (propertyPanel != null && propertyPanel.annot != null && PDFViewer.MouseMode == MouseModes.AnnotCreate)
|
|
|
{
|
|
|
- PDFViewer.SetToolParam(propertyPanel.annot);
|
|
|
+ if (StrAnnotToolChecked == key.Key)
|
|
|
+ {
|
|
|
+ PDFViewer.SetToolParam(propertyPanel.annot);
|
|
|
+ }
|
|
|
}
|
|
|
break;
|
|
|
|
|
@@ -1177,7 +1203,10 @@ namespace PDF_Master.ViewModels.Tools
|
|
|
//创建注释后,修改注释属性,可用于下次创建的注释
|
|
|
if (propertyPanel != null && propertyPanel.annot != null && PDFViewer.MouseMode == MouseModes.AnnotCreate)
|
|
|
{
|
|
|
- PDFViewer.SetToolParam(propertyPanel.annot);
|
|
|
+ if (StrAnnotToolChecked == key.Key)
|
|
|
+ {
|
|
|
+ PDFViewer.SetToolParam(propertyPanel.annot);
|
|
|
+ }
|
|
|
}
|
|
|
break;
|
|
|
|
|
@@ -1201,7 +1230,13 @@ namespace PDF_Master.ViewModels.Tools
|
|
|
// FreehandPath.Opacity = annot.Transparency;
|
|
|
// FreehandPath.Fill = new SolidColorBrush(annot.InkColor);
|
|
|
}
|
|
|
- PDFViewer.SetToolParam(annot);
|
|
|
+ if (propertyPanel != null && propertyPanel.annot != null && PDFViewer.MouseMode == MouseModes.AnnotCreate)
|
|
|
+ {
|
|
|
+ if (StrAnnotToolChecked == key.Key)
|
|
|
+ {
|
|
|
+ PDFViewer.SetToolParam(propertyPanel.annot);
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -1233,7 +1268,10 @@ namespace PDF_Master.ViewModels.Tools
|
|
|
//创建注释后,修改注释属性,可用于下次创建的注释
|
|
|
if (propertyPanel != null && propertyPanel.annot != null && PDFViewer.MouseMode == MouseModes.AnnotCreate)
|
|
|
{
|
|
|
- PDFViewer.SetToolParam(propertyPanel.annot);
|
|
|
+ if (StrAnnotToolChecked == key.Key)
|
|
|
+ {
|
|
|
+ PDFViewer.SetToolParam(propertyPanel.annot);
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
break;
|