|
@@ -752,14 +752,6 @@ namespace PDF_Office.ViewModels.PropertyPanel.AnnotPanel
|
|
|
{
|
|
|
isExist = true;
|
|
|
}
|
|
|
- //foreach (var item in views)
|
|
|
- //{
|
|
|
- // if (item is Views.TipContent.LinkAnnotTip linkAnnotTip)
|
|
|
- // {
|
|
|
- // isExist = true;
|
|
|
- // break;
|
|
|
- // }
|
|
|
- //}
|
|
|
}
|
|
|
if (isExist == false)
|
|
|
{
|
|
@@ -775,7 +767,7 @@ namespace PDF_Office.ViewModels.PropertyPanel.AnnotPanel
|
|
|
/// </summary>
|
|
|
/// <param name="sender"></param>
|
|
|
/// <param name="e"></param>
|
|
|
- private void PDFViewer_CustomNotifyHandler(object sender, CustomNotityData e)
|
|
|
+ private async void PDFViewer_CustomNotifyHandler(object sender, CustomNotityData e)
|
|
|
{
|
|
|
if (e.NotifyType == CustomNotifyType.LinkAreaLocate)
|
|
|
{
|
|
@@ -789,39 +781,36 @@ namespace PDF_Office.ViewModels.PropertyPanel.AnnotPanel
|
|
|
}
|
|
|
if (pdfViewer.ToolManager.CurrentAnnotArgs.EventType == AnnotArgsType.AnnotLink && pdfViewer.MouseMode == MouseModes.AnnotCreate)
|
|
|
{
|
|
|
- LinkAnnotArgs linkArgs = pdfViewer.ToolManager.CurrentAnnotArgs as LinkAnnotArgs;
|
|
|
- if (linkArgs.AnnotIndex == -1)
|
|
|
- {
|
|
|
- linkArgs = (LinkAnnotArgs)propertyPanel.annot;
|
|
|
- }
|
|
|
-
|
|
|
System.Windows.Size pageSize = pdfViewer.Document.GetPageSize(areaInfo.PageIndex);
|
|
|
- linkArgs.IsPositionSet = true;
|
|
|
- linkArgs.DestIndex = areaInfo.PageIndex;
|
|
|
- linkArgs.DestinationPos = new System.Windows.Point(areaInfo.Area.X, pageSize.Height - areaInfo.Area.Y);
|
|
|
- //linkArgs.AnnotIndex = LinkAnnotArgs.AnnotIndex;
|
|
|
- //linkArgs.PageIndex = LinkAnnotArgs.PageIndex;
|
|
|
|
|
|
historyPageIndex = LinkAnnotArgs.PageIndex;
|
|
|
- //LinkAnnotArgs = linkArgs;
|
|
|
- //if (linkArgs.AnnotIndex == -1)
|
|
|
- //{
|
|
|
- // LinkAnnotArgs.IsPositionSet = true;
|
|
|
- // LinkAnnotArgs.DestIndex = areaInfo.PageIndex;
|
|
|
- // LinkAnnotArgs.DestinationPos = new System.Windows.Point(areaInfo.Area.X, pageSize.Height - areaInfo.Area.Y);
|
|
|
- // LinkAnnotArgs.InvokeLinkSaveCalled(this, EventArgs.Empty);
|
|
|
- //}
|
|
|
+
|
|
|
+ AnnotAttribEvent = propertyPanel.AnnotEvent;
|
|
|
+ LinkAnnotArgs = (LinkAnnotArgs)propertyPanel.annot;
|
|
|
+
|
|
|
+ LinkAnnotArgs.IsPositionSet = true;
|
|
|
+ LinkAnnotArgs.DestIndex = areaInfo.PageIndex;
|
|
|
+ LinkAnnotArgs.DestinationPos = new System.Windows.Point(areaInfo.Area.X, pageSize.Height - areaInfo.Area.Y);
|
|
|
|
|
|
AnnotAttribEvent?.UpdateAttrib(AnnotAttrib.LinkType, LINK_TYPE.GOTO);
|
|
|
AnnotAttribEvent?.UpdateAttrib(AnnotAttrib.LinkDestIndx, areaInfo.PageIndex);
|
|
|
AnnotAttribEvent?.UpdateAnnot();
|
|
|
+ LinkAnnotArgs.InvokeLinkSaveCalled(this, EventArgs.Empty);
|
|
|
|
|
|
- linkArgs.InvokeLinkSaveCalled(this, EventArgs.Empty);
|
|
|
+
|
|
|
+ pdfViewer.GoToPage(historyPageIndex);
|
|
|
+
|
|
|
+ if (string.IsNullOrEmpty(PageNumTextContent) || PageNumTextContent != (areaInfo.PageIndex + 1).ToString())
|
|
|
+ {
|
|
|
+ await System.Threading.Tasks.Task.Delay(5);
|
|
|
+ pdfViewer.SelectAnnotation(historyPageIndex, LinkAnnotArgs.AnnotIndex);
|
|
|
+ }
|
|
|
+
|
|
|
+ BtnLocationIsChecked = false;
|
|
|
|
|
|
PageNumTextContent = (areaInfo.PageIndex + 1).ToString();
|
|
|
SetImagePreview(areaInfo.PageIndex);
|
|
|
|
|
|
- //viewContentViewModel.LinkAnnotTipVisibility = Visibility.Collapsed;
|
|
|
viewContentViewModel.TipVisible = Visibility.Collapsed;
|
|
|
|
|
|
//没有选择注释工具、也不是右键添加注释
|
|
@@ -832,19 +821,6 @@ namespace PDF_Office.ViewModels.PropertyPanel.AnnotPanel
|
|
|
pdfViewer.SetMouseMode(MouseModes.PanTool);
|
|
|
propertyPanel.IsLocationLink = false;
|
|
|
}
|
|
|
- //await System.Threading.Tasks.Task.Delay(5);
|
|
|
- pdfViewer.GoToPage(historyPageIndex);
|
|
|
-
|
|
|
- //await System.Threading.Tasks.Task.Delay(5);
|
|
|
- //pdfViewer.SelectAnnotation(historyPageIndex, LinkAnnotArgs.AnnotIndex);
|
|
|
-
|
|
|
- BtnLocationIsChecked = false;
|
|
|
- //}
|
|
|
- //else
|
|
|
- //{
|
|
|
- // CleanLocationState();
|
|
|
- // return;
|
|
|
- //}
|
|
|
}
|
|
|
}
|
|
|
}
|