|
@@ -22,6 +22,7 @@ using System.Windows.Input;
|
|
using System.Windows.Media;
|
|
using System.Windows.Media;
|
|
using static ComPDFKit.Tool.CPDFToolManager;
|
|
using static ComPDFKit.Tool.CPDFToolManager;
|
|
using System.Windows.Media.Imaging;
|
|
using System.Windows.Media.Imaging;
|
|
|
|
+using ComPDFKit.Tool.Help;
|
|
|
|
|
|
namespace Compdfkit_Tools.PDFControl
|
|
namespace Compdfkit_Tools.PDFControl
|
|
{
|
|
{
|
|
@@ -355,6 +356,8 @@ namespace Compdfkit_Tools.PDFControl
|
|
{
|
|
{
|
|
PdfViewControl.PDFViewTool.GetCPDFViewer().UndoManager.PropertyChanged -= UndoManager_PropertyChanged;
|
|
PdfViewControl.PDFViewTool.GetCPDFViewer().UndoManager.PropertyChanged -= UndoManager_PropertyChanged;
|
|
PdfViewControl.PDFViewTool.GetCPDFViewer().UndoManager.PropertyChanged += UndoManager_PropertyChanged;
|
|
PdfViewControl.PDFViewTool.GetCPDFViewer().UndoManager.PropertyChanged += UndoManager_PropertyChanged;
|
|
|
|
+ PdfViewControl.PDFToolManager.MouseLeftButtonDownHandler -= PDFToolManager_MouseLeftButtonDownHandler;
|
|
|
|
+ PdfViewControl.PDFToolManager.MouseLeftButtonDownHandler += PDFToolManager_MouseLeftButtonDownHandler;
|
|
PdfViewControl = view;
|
|
PdfViewControl = view;
|
|
PDFGrid.Child = PdfViewControl;
|
|
PDFGrid.Child = PdfViewControl;
|
|
FloatPageTool.InitWithPDFViewer(view);
|
|
FloatPageTool.InitWithPDFViewer(view);
|
|
@@ -362,6 +365,54 @@ namespace Compdfkit_Tools.PDFControl
|
|
DataContext = this;
|
|
DataContext = this;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ private void PDFToolManager_MouseLeftButtonDownHandler(object sender, MouseEventObject e)
|
|
|
|
+ {
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ if (PdfViewControl.PDFToolManager.GetToolType() != ToolType.ContentEdit)
|
|
|
|
+ {
|
|
|
|
+ PropertyContainer.Child = pdfContentEditControl;
|
|
|
|
+
|
|
|
|
+ //if (pdfTextCreateParam != null && PdfViewControl != null && PdfViewControl.PDFView != null)
|
|
|
|
+ //{
|
|
|
|
+ // if (PdfViewControl.PDFView.GetPDFEditCreateType() == CPDFEditType.EditText)
|
|
|
|
+ // {
|
|
|
|
+ // pdfContentEditControl.SetPDFTextEditData(pdfTextCreateParam);
|
|
|
|
+ // }
|
|
|
|
+ // else if (PdfViewControl.PDFView.GetPDFEditCreateType() == CPDFEditType.None)
|
|
|
|
+ // {
|
|
|
|
+ // pdfContentEditControl.ClearContentControl();
|
|
|
|
+ // }
|
|
|
|
+ //}
|
|
|
|
+ //else
|
|
|
|
+ //{
|
|
|
|
+ // pdfContentEditControl.ClearContentControl();
|
|
|
|
+ //}
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+ CPDFEditType createContentEditType = PdfViewControl.PDFToolManager.GetCreateContentEditType();
|
|
|
|
+ if (createContentEditType == CPDFEditType.EditText)
|
|
|
|
+ {
|
|
|
|
+ CPDFEditArea editAreaArea = PdfViewControl.PDFToolManager.GetSelectedEditAreaObject();
|
|
|
|
+ PDFEditParam pDFEditParam= ParamConverter.CPDFDataConverterToPDFEitParam(PdfViewControl.PDFToolManager.GetDocument(), editAreaArea);
|
|
|
|
+ pdfContentEditControl.SetPDFTextEditData((TextEditParam)pDFEditParam, true);
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ if (createContentEditType == CPDFEditType.EditImage && PdfViewControl != null)
|
|
|
|
+ {
|
|
|
|
+ UIElement pageView = sender as UIElement;
|
|
|
|
+ if (pageView != null)
|
|
|
|
+ {
|
|
|
|
+ pageView.MouseLeftButtonUp += PageView_MouseLeftButtonUp;
|
|
|
|
+ }
|
|
|
|
+ CPDFEditArea editAreaArea = PdfViewControl.PDFToolManager.GetSelectedEditAreaObject();
|
|
|
|
+ PDFEditParam pDFEditParam = ParamConverter.CPDFDataConverterToPDFEitParam(PdfViewControl.PDFToolManager.GetDocument(), editAreaArea);
|
|
|
|
+ pdfContentEditControl.SetPDFImageEditData((ImageEditParam)pDFEditParam);
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
|
|
/// <summary>
|
|
/// <summary>
|
|
/// Text and Image Selected Event
|
|
/// Text and Image Selected Event
|