|
@@ -1543,13 +1543,13 @@ namespace PDF_Master.ViewModels.FillAndSign
|
|
|
|
|
|
private void PDFViewer_AnnotEditHandler(object sender, List<AnnotEditEvent> e)
|
|
|
{
|
|
|
- bool IsSign = false;
|
|
|
+ bool IsAdd = false;
|
|
|
if (e != null && e.Count > 0)
|
|
|
{
|
|
|
int i = 0;
|
|
|
Dictionary<int, List<int>> selectAnnotDicts = new Dictionary<int, List<int>>();
|
|
|
|
|
|
- for ( i = 0; i < e.Count; i++)
|
|
|
+ for (i = 0; i < e.Count; i++)
|
|
|
{
|
|
|
AnnotEditEvent editEvent = e[i];
|
|
|
int pageindex = editEvent.PageIndex;
|
|
@@ -1558,17 +1558,17 @@ namespace PDF_Master.ViewModels.FillAndSign
|
|
|
{
|
|
|
case ActionType.Add:
|
|
|
|
|
|
-
|
|
|
- if (selectAnnotDicts.ContainsKey(editEvent.PageIndex) == false)
|
|
|
- {
|
|
|
- selectAnnotDicts.Add(editEvent.PageIndex, new List<int>());
|
|
|
- selectAnnotDicts[editEvent.PageIndex].Add(editEvent.AnnotIndex);
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- selectAnnotDicts[editEvent.PageIndex].Add(editEvent.AnnotIndex);
|
|
|
- }
|
|
|
-
|
|
|
+ IsAdd = true;
|
|
|
+ if (selectAnnotDicts.ContainsKey(editEvent.PageIndex) == false)
|
|
|
+ {
|
|
|
+ selectAnnotDicts.Add(editEvent.PageIndex, new List<int>());
|
|
|
+ selectAnnotDicts[editEvent.PageIndex].Add(editEvent.AnnotIndex);
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ selectAnnotDicts[editEvent.PageIndex].Add(editEvent.AnnotIndex);
|
|
|
+ }
|
|
|
+
|
|
|
//if (editEvent.EditAnnotArgs.EventType == AnnotArgsType.AnnotFreehand)
|
|
|
//{
|
|
|
// //if (IsSelectShape)
|
|
@@ -1603,9 +1603,10 @@ namespace PDF_Master.ViewModels.FillAndSign
|
|
|
PDFViewer.SelectAnnotation(pageindex, annotindex);
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
}
|
|
|
- if (editEvent.EditAnnotArgs.EventType == AnnotArgsType.AnnotFreehand&&i==0) {
|
|
|
+ if (editEvent.EditAnnotArgs.EventType == AnnotArgsType.AnnotFreehand && i == 0)
|
|
|
+ {
|
|
|
PDFViewer.SelectAnnotation(pageindex, annotindex);
|
|
|
}
|
|
|
//else
|
|
@@ -1627,7 +1628,7 @@ namespace PDF_Master.ViewModels.FillAndSign
|
|
|
break;
|
|
|
}
|
|
|
}
|
|
|
- if (i>1)
|
|
|
+ if (i > 1 && IsAdd)
|
|
|
{
|
|
|
PDFViewer.SelectAnnotation(selectAnnotDicts);
|
|
|
}
|
|
@@ -1807,7 +1808,7 @@ namespace PDF_Master.ViewModels.FillAndSign
|
|
|
|
|
|
}
|
|
|
}
|
|
|
- private void ShowPropertyPanel(bool show = true)
|
|
|
+ public void ShowPropertyPanel(bool show = true)
|
|
|
{
|
|
|
viewContentViewModel.IsPropertyOpen = show;
|
|
|
}
|
|
@@ -1859,7 +1860,20 @@ namespace PDF_Master.ViewModels.FillAndSign
|
|
|
// IsCopyShape = false;
|
|
|
// }
|
|
|
//}
|
|
|
-
|
|
|
+ public void ExitAnnotationTool()
|
|
|
+ {
|
|
|
+ PDFViewer.DisableClearSelectAnnot(false);
|
|
|
+ PDFViewer.ClearSelectAnnots();
|
|
|
+ PDFViewer.SetMouseMode(MouseModes.PanTool);
|
|
|
+ if (PDFViewer.MouseMode != MouseModes.AnnotCreate)
|
|
|
+ {
|
|
|
+ PDFViewer.SetMouseMode(MouseModes.AnnotCreate);
|
|
|
+ var annotArgs = new SelectToolArgs();
|
|
|
+ PDFViewer.SetToolParam(annotArgs);
|
|
|
+ }
|
|
|
+ viewContentViewModel.SelectedPrpoertyPanel("PropertyPanelContent", null);
|
|
|
+ ShowPropertyPanel(false);
|
|
|
+ }
|
|
|
#region Navigation
|
|
|
|
|
|
public bool IsNavigationTarget(NavigationContext navigationContext)
|
|
@@ -1880,14 +1894,16 @@ namespace PDF_Master.ViewModels.FillAndSign
|
|
|
|
|
|
public void OnNavigatedTo(NavigationContext navigationContext)
|
|
|
{
|
|
|
+
|
|
|
IsFillAndSign = true;
|
|
|
navigationContext.Parameters.TryGetValue<ViewContentViewModel>(ParameterNames.ViewContentViewModel, out viewContentViewModel);
|
|
|
navigationContext.Parameters.TryGetValue<CPDFViewer>(ParameterNames.PDFViewer, out PDFViewer);
|
|
|
BindingPDFViewerHandler();
|
|
|
+ ExitAnnotationTool();
|
|
|
HookShapeIsCheck = true;
|
|
|
HookShapeIsCheck = false;
|
|
|
- ShowPropertyPanel(false);
|
|
|
- PDFViewer.SetMouseMode(MouseModes.PanTool);
|
|
|
+ //ShowPropertyPanel(false);
|
|
|
+ //PDFViewer.SetMouseMode(MouseModes.PanTool);
|
|
|
// InitCheckedEvent("RbtnTick");
|
|
|
IsEdit = false;
|
|
|
|